denoland / denoland/std

`deno test`: beforeEach() prevents use of permissions configuration

Open
#6,377 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

This may or may not be intended behaviour. However I think at least the behaviour/error message is unintuitive, because it is not necessarily obvious as a user that `beforeEach` is in the nested hierarchy.

When creating a test like this:

```typescript

beforeEach(() => {
console.log('this acts as an outer nested scope called "global"')
console.log('but there is no way to assign permissions on this outer nested layer')
});

const permissions = {
run: true,
write: true,
};

describe("example",{ permissions }, () => {
it("should do some foo", async () => {
// Error: permissions option not available for nested tests
});
});
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the TypeScript example with `deno test`, focusing on the interaction between the top-level `beforeEach`, nested `describe`, and its `permissions` option. Determine whether the restriction is intended and what behavior or error message would make the scope clear; the issue does not name implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.