Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Permissions to TestDefinition #9859

Closed
caspervonb opened this issue Mar 22, 2021 · 0 comments · Fixed by #10188
Closed

Add Permissions to TestDefinition #9859

caspervonb opened this issue Mar 22, 2021 · 0 comments · Fixed by #10188
Labels
suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage

Comments

@caspervonb
Copy link
Contributor

caspervonb commented Mar 22, 2021

Would be nice to be able to specify the permissions a test should run in.

Deno.test({
  name: "foo",
  fn() {
    assertThrows(function() {
      Deno.open("...");
    });
  },
  permissions: {
    write: false,
  },
});

To avoid breaking the sandboxing rules, this would not be able to request more permissions than the initial set that was given to deno test but can reset the permission set to that before every test is run.

@caspervonb caspervonb changed the title Add TestPermissions to TestDefinition Add Permissions to TestDefinition Mar 22, 2021
@kitsonk kitsonk added suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage labels Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants