diff --git a/examples/angular/jest.config.js b/examples/angular/jest.config.js index 06e6c25e3075..18094f1ba955 100644 --- a/examples/angular/jest.config.js +++ b/examples/angular/jest.config.js @@ -1,7 +1,7 @@ module.exports = { moduleFileExtensions: ['ts', 'html', 'js', 'json'], setupFilesAfterEnv: ['/setupJest.js'], - testEnvironment: 'jsdom', + testEnvironment: '/test-env.js', transform: { '\\.[tj]s$': ['babel-jest', {configFile: require.resolve('./.babelrc')}], }, diff --git a/examples/angular/test-env.js b/examples/angular/test-env.js new file mode 100644 index 000000000000..29e800ced2b0 --- /dev/null +++ b/examples/angular/test-env.js @@ -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'); + } +};