Skip to content

Commit

Permalink
test: worker hooks tags
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Nov 23, 2024
1 parent 100d13a commit fc77ce9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/hooks-tags-worker/features/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ BeforeAll({ tags: '@feature2' }, ({ $workerInfo }) => {
logger.log(`worker ${$workerInfo.workerIndex}: BeforeAll for feature 2`);
});

BeforeAll({ tags: '@feature1 or @feature2' }, ({ $workerInfo }) => {
logger.log(`worker ${$workerInfo.workerIndex}: BeforeAll for feature (1 or 2)`);
});

AfterAll(({ $workerInfo }) => {
logger.log(`worker ${$workerInfo.workerIndex}: AfterAll 1`);
});
Expand Down
1 change: 1 addition & 0 deletions test/hooks-tags-worker/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test(`${testDir.name} (1 worker)`, () => {
expect(countOfSubstring(stdout, 'worker 0: BeforeAll 1')).toEqual(1);
expect(countOfSubstring(stdout, 'worker 0: BeforeAll 2')).toEqual(1);
expect(countOfSubstring(stdout, 'worker 0: BeforeAll for feature 1')).toEqual(1);
expect(countOfSubstring(stdout, 'worker 0: BeforeAll for feature (1 or 2)')).toEqual(1);
expect(countOfSubstring(stdout, 'worker 0: a step of scenario 1')).toEqual(1);
// after all should be called after feature 2 !!!
expect(countOfSubstring(stdout, 'worker 0: AfterAll 2')).toEqual(1);
Expand Down

0 comments on commit fc77ce9

Please sign in to comment.