Skip to content

Commit

Permalink
test(examples): fix ng13 esm example (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
johncrim authored Jan 18, 2022
1 parent 5b96649 commit 06bfb08
Show file tree
Hide file tree
Showing 9 changed files with 812 additions and 531 deletions.
1 change: 0 additions & 1 deletion examples/example-app-v13/jest-esm.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
},
},
globalSetup: 'jest-preset-angular/global-setup',
moduleNameMapper: {
...pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }),
tslib: 'tslib/tslib.es6.js',
Expand Down
1 change: 0 additions & 1 deletion examples/example-app-v13/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const { paths } = require('./tsconfig.json').compilerOptions;
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'jest-preset-angular',
globalSetup: 'jest-preset-angular/global-setup',
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }),
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
};
34 changes: 17 additions & 17 deletions examples/example-app-v13/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~13.1.1",
"@angular/common": "~13.1.1",
"@angular/compiler": "~13.1.1",
"@angular/core": "~13.1.1",
"@angular/forms": "~13.1.1",
"@angular/platform-browser": "~13.1.1",
"@angular/platform-browser-dynamic": "~13.1.1",
"@angular/router": "~13.1.1",
"angular-in-memory-web-api": "^0.11.0",
"rxjs": "~7.4.0",
"@angular/animations": "~13.1.2",
"@angular/common": "~13.1.2",
"@angular/compiler": "~13.1.2",
"@angular/core": "~13.1.2",
"@angular/forms": "~13.1.2",
"@angular/platform-browser": "~13.1.2",
"@angular/platform-browser-dynamic": "~13.1.2",
"@angular/router": "~13.1.2",
"angular-in-memory-web-api": "^0.13.0",
"rxjs": "~7.5.2",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.1.2",
"@angular/cli": "~13.1.2",
"@angular/compiler-cli": "~13.1.1",
"@angular-devkit/build-angular": "~13.1.3",
"@angular/cli": "~13.1.3",
"@angular/compiler-cli": "~13.1.2",
"@types/jest": "^27.4.0",
"@types/node": "^12.11.1",
"jest": "^27.4.5",
"@types/node": "^17.0.8",
"jest": "^27.4.7",
"jest-preset-angular": "^11.0.1",
"typescript": "~4.4.3"
"typescript": "~4.5.4"
}
}
}
10 changes: 9 additions & 1 deletion examples/example-app-v13/setup-jest.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
import 'jest-preset-angular/setup-jest';
// Can't use standard setup-jest, b/c it uses require()
// import 'jest-preset-angular/setup-jest';

import 'zone.js/fesm2015/zone-testing-bundle.min.js';
import './jest-global-mocks';

import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';

getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
Loading

0 comments on commit 06bfb08

Please sign in to comment.