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 9, 2022
1 parent 9898099 commit 5458af7
Show file tree
Hide file tree
Showing 2 changed files with 11 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
10 changes: 10 additions & 0 deletions examples/angular/test-env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const BaseJSDOMEnv = require('jest-environment-jsdom');

module.exports = class AngularEnv extends BaseJSDOMEnv {
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 5458af7

Please sign in to comment.