add assertResources sanitizer to cli/js/ unit tests (#4161)

This commit is contained in:
Bartek Iwańczuk 2020-02-29 18:45:47 +01:00 committed by GitHub
parent 199fb195f3
commit f55b22e195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 95 additions and 36 deletions

View file

@ -31,8 +31,9 @@ testPerm({ net: true }, async function resourcesNet(): Promise<void> {
testPerm({ read: true }, async function resourcesFile(): Promise<void> {
const resourcesBefore = Deno.resources();
await Deno.open("cli/tests/hello.txt");
const f = await Deno.open("cli/tests/hello.txt");
const resourcesAfter = Deno.resources();
f.close();
// check that exactly one new resource (file) was added
assertEquals(