Skip to content

Commit

Permalink
test(e2e): pure jest configuration #610
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Jul 25, 2021
1 parent a7f9882 commit a833c40
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion e2e/a-jest/jest.es2015ivy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
preset: 'jest-preset-angular',
testRunner: 'jest-jasmine2',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
Expand Down
1 change: 0 additions & 1 deletion e2e/a-jest/jest.es5ivy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
preset: 'jest-preset-angular',
testRunner: 'jest-jasmine2',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
Expand Down
6 changes: 0 additions & 6 deletions e2e/a-jest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion e2e/a-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@angular-devkit/build-angular": "12.1.3",
"@angular/cli": "12.1.3",
"@angular/compiler-cli": "12.1.3",
"@types/jasmine": "3.8.1",
"@types/jest": "26.0.24",
"@types/node": "14.17.6",
"jest": "27.0.6",
Expand Down
4 changes: 4 additions & 0 deletions e2e/a-jest/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ ngMocks.defaultMock(AppService, () => ({
}));

describe('app-component', () => {
// A fix until https://github.com/facebook/jest/issues/11483 has been merged.
MockInstance.scope('all');
MockInstance.scope();

const factory = MockRenderFactory(AppComponent, ['scope']);
ngMocks.faster();
beforeAll(() => MockBuilder(AppComponent, AppModule));
Expand Down
7 changes: 0 additions & 7 deletions e2e/a-jest/src/setup-jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@ import 'jest-preset-angular/setup-jest';
import { MockInstance, ngMocks } from 'ng-mocks';

ngMocks.autoSpy('jest');

jasmine.getEnv().addReporter({
specDone: MockInstance.restore,
specStarted: MockInstance.remember,
suiteDone: MockInstance.restore,
suiteStarted: MockInstance.remember,
});
2 changes: 1 addition & 1 deletion e2e/a-jest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"skipLibCheck": true,
"types": ["jasmine", "jest", "node"]
"types": ["jest", "node"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down
1 change: 0 additions & 1 deletion e2e/a-min/jest.es2015ivy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
preset: 'jest-preset-angular',
testRunner: 'jest-jasmine2',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
Expand Down
1 change: 0 additions & 1 deletion e2e/a-min/jest.es5ivy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
preset: 'jest-preset-angular',
testRunner: 'jest-jasmine2',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
testURL: 'http://localhost',
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
Expand Down

0 comments on commit a833c40

Please # to comment.