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..1c06ac0b793e --- /dev/null +++ b/examples/angular/test-env.js @@ -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'); + } +};