Skip to content

Commit

Permalink
feat: Integrate Jest for JavaScript testing with CI setup (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: sourcery-ai[bot] <sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Fabian Braun <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent badded7 commit 2a3ba24
Show file tree
Hide file tree
Showing 15 changed files with 12,636 additions and 6,661 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
run: npm install
- name: Build bundles
run: webpack --mode=production
# - name: Run gulp
# run: gulp ci
- name: Run jest
run: npx jest
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 2a3ba24

Please sign in to comment.