Skip to content

Commit

Permalink
fix(jest): migrate jest-preset-angular to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Mar 23, 2020
1 parent a465fa3 commit 09de4c9
Show file tree
Hide file tree
Showing 34 changed files with 104 additions and 75 deletions.
7 changes: 4 additions & 3 deletions apps/webapp/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
testPathIgnorePatterns: ['/e2e/'],
coverageDirectory: '../../coverage/apps/webapp',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
],
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
]
};
5 changes: 3 additions & 2 deletions libs/admin/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/admin',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/app-confirm/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/app-confirm',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/auth/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/auth',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/breadcrumbs/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/breadcrumbs',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/chat-box/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/chat-box',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/clap/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/clap',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/context-menu/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/context-menu',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/core',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/dashboard/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/dashboard',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/draggable/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/draggable',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/experiments/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/experiments',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/grid/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/grid',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/home/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/home',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/image-comparison/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/image-comparison',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/json-diff/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/json-diff',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/led/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/led',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/loading-overlay/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/loading-overlay',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/navigator/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/navigator',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
7 changes: 4 additions & 3 deletions libs/ngx-utils/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
transformIgnorePatterns: ['node_modules/(?!date-fns)'],
coverageDirectory: '../../coverage/libs/ngx-utils',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
],
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { By } from '@angular/platform-browser';
import { Observable, of } from 'rxjs';
import { NgLetDirective } from './ng-let.directive';
import { NgLetModule } from './ng-let.module';
import { MatPaginator } from '@angular/material';

@Component({
template: '',
Expand All @@ -24,7 +23,7 @@ class TestComponent {
imports: [NgLetModule, CommonModule],
exports: [NgLetModule, TestComponent],
})
class TestModule {}
class TestModule { }

describe('ngLet directive', () => {
let fixture: ComponentFixture<TestComponent>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterLinkMatchDirective } from './router-link-match.directive';
import { RouterLinkMatchModule } from './router-link-match.module';
import { MatPaginator } from '@angular/material';

@Component({
template: `
Expand All @@ -18,7 +17,7 @@ import { MatPaginator } from '@angular/material';
`,
selector: 'test-1',
})
class Test1Component {}
class Test1Component { }

@Component({
template: `
Expand All @@ -32,7 +31,7 @@ class Test1Component {}
`,
selector: 'test-2',
})
class Test2Component {}
class Test2Component { }

@Component({
template: `
Expand All @@ -47,7 +46,7 @@ class Test2Component {}
`,
selector: 'test-3',
})
class Test3Component {}
class Test3Component { }

@Component({
template: `
Expand All @@ -71,7 +70,7 @@ class Test4Component {
<router-outlet></router-outlet><test-3></test-3><test-4></test-4>
`,
})
class RootComponent {}
class RootComponent { }

function advance(fixture: ComponentFixture<any>): void {
tick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DateFnsModule } from './date-fns.module';
import { FormatTimeInWordsPipe } from './format-time-in-words.pipe';

class MockChangeDetector {
markForCheck(): void {}
markForCheck(): void { }
}

function drinkFlavor(flavor) {
Expand All @@ -15,7 +15,7 @@ function drinkFlavor(flavor) {

describe('FormatTimeInWordsPipe', () => {
const fakeChangeDetectorRef = {
markForCheck: () => {}
markForCheck: () => { }
};

beforeEach(() => {
Expand Down Expand Up @@ -52,10 +52,10 @@ describe('FormatTimeInWordsPipe', () => {
expect(pipe.transform(yesterday)).toBe('1 day ago');
}));

it('should return `about 24 years ago` when date is 1995-12-17T03:24:00', inject(
it('should return `over 24 years ago` when date is 1995-12-17T03:24:00', inject(
[FormatTimeInWordsPipe],
(pipe: FormatTimeInWordsPipe) => {
expect(pipe.transform('1995-12-17T03:24:00')).toBe('about 24 years ago');
expect(pipe.transform('1995-12-17T03:24:00')).toBe('over 24 years ago');
}
));

Expand Down
5 changes: 3 additions & 2 deletions libs/not-found/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/not-found',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/notifications/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/notifications',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/quickpanel/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/quickpanel',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/scrollbar/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/scrollbar',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/shared/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/shared',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/sidenav/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/sidenav',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
5 changes: 3 additions & 2 deletions libs/socketio-plugin/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/socketio-plugin',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
],
};
Loading

0 comments on commit 09de4c9

Please sign in to comment.