Skip to content

Commit

Permalink
Merge pull request #1433 from Adslot/test-up
Browse files Browse the repository at this point in the history
chore: test packages upgrade
  • Loading branch information
bchew authored Jun 30, 2022
2 parents f55ef05 + da228c9 commit 0485433
Show file tree
Hide file tree
Showing 8 changed files with 2,245 additions and 2,604 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
node-version: ${{matrix.node}}
- run: npm -v
- run: npm ci
- name: Run npm test
- name: Run jest coverage
run: |
set -o pipefail
npm test | tee /tmp/test-output.log
npm run coverage | tee /tmp/test-output.log
- name: Check for missed warnings/errors
run: |
if grep -E "console.error|Error:|ERROR:|ERROR: 'Warning|Warning:|WARN:|WARN \[web-server\]" /tmp/test-output.log; then
Expand Down
1 change: 0 additions & 1 deletion __mocks__/fileMock.js

This file was deleted.

12 changes: 0 additions & 12 deletions __mocks__/popper.js.js

This file was deleted.

9 changes: 9 additions & 0 deletions config/cssTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
process() {
return { code: 'module.exports = {};' };
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};
2 changes: 1 addition & 1 deletion jest.setup.js → config/testSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Enzyme.configure({
disableLifecycleMethods: true,
});

window.matchMedia = jest.fn().mockImplementation(query => {
window.matchMedia = jest.fn().mockImplementation((query) => {
return {
matches: false,
media: query,
Expand Down
10 changes: 3 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json'],
transform: {
'^.+\\.(js|jsx)?$': 'babel-jest',
'^.+\\.css$': '<rootDir>/config/cssTransform.js',
},
moduleDirectories: ['node_modules', __dirname],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$'],
clearMocks: true,
coverageDirectory: 'coverage',
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.css$': 'identity-obj-proxy',
},
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
setupFilesAfterEnv: ['<rootDir>/config/testSetup.js'],
coverageThreshold: {
global: {
statements: 100,
Expand Down
Loading

0 comments on commit 0485433

Please sign in to comment.