Skip to content

Commit

Permalink
feat: Integrate Jest for JavaScript testing with CI setup
Browse files Browse the repository at this point in the history
Set up a modern JavaScript testing framework using Jest, integrated with the existing webpack build system. Configure Babel for modern JavaScript support and establish a test file structure and conventions. Update the package.json to include Jest dependencies and scripts for running tests, watching tests, and generating coverage reports. Set up a continuous integration pipeline to run JavaScript tests alongside existing Python tests.

New Features:
- Introduce a modern JavaScript testing framework using Jest, integrated with the existing webpack build system.

Enhancements:
- Configure Babel for modern JavaScript support with a new Babel configuration file.

CI:
- Set up a continuous integration pipeline to run JavaScript tests alongside existing Python tests.

Tests:
- Establish a test file structure and conventions for JavaScript tests, including an example test file to verify the setup.
- Configure test coverage reporting for JavaScript code.

Resolves #27
  • Loading branch information
sourcery-ai[bot] committed Nov 20, 2024
1 parent 0ad8ff2 commit 3926c69
Show file tree
Hide file tree
Showing 9 changed files with 10,138 additions and 5,368 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Jest coverage
/coverage
*.py[cod]
*$py.class
*.egg-info
Expand Down
9 changes: 9 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
presets: [
['@babel/preset-env', {
targets: {
node: 'current',
},
}],
],
};
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/tests/js/setup-tests.js'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/tests/js/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg)$': '<rootDir>/tests/js/__mocks__/fileMock.js'
},
testMatch: [
'**/tests/js/**/*.test.js'
],
coverageDirectory: 'coverage',
collectCoverageFrom: [
'private/js/**/*.js',
'!**/node_modules/**'
]
};
Loading

0 comments on commit 3926c69

Please sign in to comment.