Skip to content

Commit

Permalink
Tests: Run tests with Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 30, 2023
1 parent da4eedb commit 23edba9
Show file tree
Hide file tree
Showing 6 changed files with 5,573 additions and 2,051 deletions.
17 changes: 17 additions & 0 deletions jest-eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* --------------------
* yauzl-promise module
* Jest ESLint runner config
* ------------------*/

'use strict';

// Exports

module.exports = {
testEnvironment: 'node',
runner: 'jest-runner-eslint',
testMatch: ['<rootDir>/**/*.(js|cjs|mjs|jsx)'],
// Jest by default uses a number of workers equal to number of CPU cores minus 1.
// Github Actions runners provide 2 cores and running with 2 workers is faster than 1.
...(process.env.CI && {maxWorkers: '100%'})
};
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* --------------------
* yauzl-promise module
* Jest config
* ------------------*/

'use strict';

// Exports

module.exports = {
testEnvironment: 'node',
coverageDirectory: 'coverage',
collectCoverageFrom: ['index.js', 'lib/**/*.js'],
setupFilesAfterEnv: ['jest-extended/all'],
// Jest by default uses a number of workers equal to number of CPU cores minus 1.
// Github Actions runners provide 2 cores and running with 2 workers is faster than 1.
...(process.env.CI && {maxWorkers: '100%'})
};
Loading

0 comments on commit 23edba9

Please sign in to comment.