Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olexandr13 committed Nov 14, 2024
1 parent 50b18c4 commit a54a20d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example/jest/jest-concurrent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('suite', () => {
it('it concurrent', () => {});
it.concurrent('it concurrent', () => {});
test.concurrent('test concurrent', () => {});
});
19 changes: 19 additions & 0 deletions tests/jest_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,23 @@ describe('jest parser', () => {
expect(tests[0].code).to.not.include('4: beforeAll(() => {\n');
});
});

context('jest concurrent', () => {
let fileSource, fileAst;

before(() => {
fileSource = fs.readFileSync('./example/jest/jest-concurrent.js').toString();
fileAst = parser.parse(fileSource);
});

it('shuld parse it.concurrent', () => {
const tests = jestParser(fileAst);
expect(tests[0].name).to.equal('it concurrent');
});

it('should parse test.concurrent', () => {
const tests = jestParser(fileAst);
expect(tests[1].name).to.equal('test concurrent');
});
});
});

0 comments on commit a54a20d

Please sign in to comment.