Skip to content

Commit 8dce252

Browse files
authored
Replace mocha with jest (#470)
* Replace mocha with jest * Remove unnecessary @babel/register * Move chai setup to each test file This allows us moving to Jest built-in matchers one test file at a time * Remove xvfb from github workflow * Move timeout configuration to describe block * Use spawn instead of exec
1 parent c93fd2b commit 8dce252

File tree

14 files changed

+2360
-519
lines changed

14 files changed

+2360
-519
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ jobs:
2929
- name: Build sources
3030
run: npm run build
3131

32-
- name: Run tests with xvfb available
33-
uses: GabrielBB/xvfb-action@v1
34-
with:
35-
run: npm run test
32+
- name: Run tests
33+
run: npm run test
3634

3735
lint:
3836
runs-on: ubuntu-latest

jest.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Jest configuration
2+
// Reference: https://jestjs.io/docs/configuration
3+
4+
module.exports = {
5+
testMatch: [
6+
'**/test/*.js'
7+
],
8+
testPathIgnorePatterns: [
9+
'<rootDir>/test/helpers.js'
10+
],
11+
setupFilesAfterEnv: [
12+
'<rootDir>/test/helpers.js'
13+
],
14+
watchPathIgnorePatterns: [
15+
// Ignore the output generated by plugin tests
16+
// when watching for changes to avoid the test
17+
// runner continuously re-running tests
18+
'<rootDir>/test/output'
19+
]
20+
};

0 commit comments

Comments
 (0)