Skip to content

Commit

Permalink
fix angular test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 10, 2022
1 parent 525ff0c commit b3f09d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/angular/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
moduleFileExtensions: ['ts', 'html', 'js', 'json'],
setupFilesAfterEnv: ['<rootDir>/setupJest.js'],
testEnvironment: 'jsdom',
testEnvironment: '<rootDir>/test-env.js',
transform: {
'\\.[tj]s$': ['babel-jest', {configFile: require.resolve('./.babelrc')}],
},
Expand Down
12 changes: 12 additions & 0 deletions examples/angular/test-env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const {
TestEnvironment: JSDOMTestEnvironment,
} = require('jest-environment-jsdom');

module.exports = class AngularEnv extends JSDOMTestEnvironment {
exportConditions() {
// we need to include `node` as `rxjs` defines `node`, `es2015`, `default`, not `browser` or `require`
return super.exportConditions().concat('node');
}
};

0 comments on commit b3f09d9

Please sign in to comment.