Skip to content

Commit eb14beb

Browse files
author
anh.pham
committed
chore(release): 11.1.2
1 parent 3899abf commit eb14beb

File tree

97 files changed

+3429
-2743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3429
-2743
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [11.1.2](https://github.com/thymikee/jest-preset-angular/compare/v11.1.1...v11.1.2) (2022-04-24)
2+
3+
4+
### Bug Fixes
5+
6+
* correct deprecation message of `ngcc-jest-processor` ([3899abf](https://github.com/thymikee/jest-preset-angular/commit/3899abf5b886826a00d443db364d7b1fb085122b)), closes [#1411](https://github.com/thymikee/jest-preset-angular/issues/1411)
7+
8+
9+
110
## [11.1.1](https://github.com/thymikee/jest-preset-angular/compare/v11.0.1...v11.1.1) (2022-02-11)
211

312

e2e/ast-transformers/ng-jit-transformers/__tests__/bar.component.spec.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
1616
})
1717
class BarComponent {}
1818

19-
test('templateUrl/styleUrls/styles should work', waitForAsync(() => {
20-
TestBed.configureTestingModule({
21-
declarations: [BarComponent],
22-
});
23-
const fixture = TestBed.createComponent(BarComponent);
24-
fixture.detectChanges();
19+
test(
20+
'templateUrl/styleUrls/styles should work',
21+
waitForAsync(() => {
22+
TestBed.configureTestingModule({
23+
declarations: [BarComponent],
24+
});
25+
const fixture = TestBed.createComponent(BarComponent);
26+
fixture.detectChanges();
2527

26-
const elementToFind = fixture.debugElement.nativeElement.querySelector('p');
27-
expect(elementToFind).toBeDefined();
28-
expect(window.getComputedStyle(elementToFind).color).toEqual('');
29-
expect(window.getComputedStyle(elementToFind).fontSize).toEqual('');
30-
}));
28+
const elementToFind = fixture.debugElement.nativeElement.querySelector('p');
29+
expect(elementToFind).toBeDefined();
30+
expect(window.getComputedStyle(elementToFind).color).toEqual('');
31+
expect(window.getComputedStyle(elementToFind).fontSize).toEqual('');
32+
}),
33+
);

e2e/async/__tests__/async.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ describe('async with Angular testing apis', () => {
7373
expect(flag).toBe(true);
7474
}));
7575

76-
test('waitForAsync should work', waitForAsync(() => {
77-
let flag = false;
78-
setTimeout(() => {
79-
flag = true;
80-
expect(flag).toBe(true);
81-
}, 100);
82-
}));
76+
test(
77+
'waitForAsync should work',
78+
waitForAsync(() => {
79+
let flag = false;
80+
setTimeout(() => {
81+
flag = true;
82+
expect(flag).toBe(true);
83+
}, 100);
84+
}),
85+
);
8386
});

e2e/full-ivy-lib/__tests__/full-ivy-lib.spec.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ describe('Full Ivy library', () => {
55
let fullIvyComponent: FullIvyComponent;
66
let fullIvyService: FullIvyService;
77

8-
beforeEach(waitForAsync(() => {
9-
TestBed.configureTestingModule({
10-
imports: [FullIvyModule],
11-
});
8+
beforeEach(
9+
waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
imports: [FullIvyModule],
12+
});
1213

13-
fullIvyComponent = TestBed.createComponent(FullIvyComponent).componentInstance;
14-
fullIvyService = TestBed.inject(FullIvyService);
15-
}));
14+
fullIvyComponent = TestBed.createComponent(FullIvyComponent).componentInstance;
15+
fullIvyService = TestBed.inject(FullIvyService);
16+
}),
17+
);
1618

1719
test('should create the component instance', () => {
1820
expect(fullIvyComponent).toBeDefined();

e2e/partial-ivy-lib/__tests__/partial-ivy-lib.spec.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ describe('Partial Ivy library', () => {
66
let partialIvyComponent: PartialIvyComponent;
77
let partialIvyService: PartialIvyService;
88

9-
beforeEach(waitForAsync(() => {
10-
TestBed.configureTestingModule({
11-
imports: [PartialIvyModule, PartialIvyTestingModule],
12-
});
9+
beforeEach(
10+
waitForAsync(() => {
11+
TestBed.configureTestingModule({
12+
imports: [PartialIvyModule, PartialIvyTestingModule],
13+
});
1314

14-
partialIvyComponent = TestBed.createComponent(PartialIvyComponent).componentInstance;
15-
partialIvyService = TestBed.inject(PartialIvyService);
16-
}));
15+
partialIvyComponent = TestBed.createComponent(PartialIvyComponent).componentInstance;
16+
partialIvyService = TestBed.inject(PartialIvyService);
17+
}),
18+
);
1719

1820
test('should create the component instance', () => {
1921
expect(partialIvyComponent).toBeDefined();

e2e/snapshot-serializers/__tests__/foo.component.spec.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ class FooComponent {
2222
condition2 = false;
2323
}
2424

25-
test('snapshot should work', waitForAsync(() => {
26-
TestBed.configureTestingModule({
27-
declarations: [FooComponent],
28-
});
25+
test(
26+
'snapshot should work',
27+
waitForAsync(() => {
28+
TestBed.configureTestingModule({
29+
declarations: [FooComponent],
30+
});
2931

30-
const fixture = TestBed.createComponent(FooComponent);
31-
fixture.detectChanges();
32+
const fixture = TestBed.createComponent(FooComponent);
33+
fixture.detectChanges();
3234

33-
expect(fixture).toMatchSnapshot();
34-
expect(fixture.debugElement.nativeElement).toMatchSnapshot();
35-
}));
35+
expect(fixture).toMatchSnapshot();
36+
expect(fixture.debugElement.nativeElement).toMatchSnapshot();
37+
}),
38+
);

examples/example-app-v11/src/app/app-initial.component.spec.ts

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,38 @@ import { ComponentFixture } from '@angular/core/testing';
55
import { AppComponent } from './app-initial.component';
66

77
describe('AppComponent (initial CLI version)', () => {
8-
beforeEach(waitForAsync(() => {
9-
TestBed.configureTestingModule({
10-
declarations: [AppComponent],
11-
}).compileComponents();
12-
}));
13-
it('should create the app', waitForAsync(() => {
14-
const fixture = TestBed.createComponent(AppComponent);
15-
const app = fixture.componentInstance;
16-
expect(app).toBeTruthy();
17-
}));
18-
it(`should have as title 'app'`, waitForAsync(() => {
19-
const fixture = TestBed.createComponent(AppComponent);
20-
const app = fixture.componentInstance;
21-
expect(app.title).toEqual('app');
22-
}));
23-
it('should render title', waitForAsync(() => {
24-
const fixture = TestBed.createComponent(AppComponent);
25-
fixture.detectChanges();
26-
const compiled = fixture.nativeElement as HTMLElement;
27-
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome to app!');
28-
}));
8+
beforeEach(
9+
waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [AppComponent],
12+
}).compileComponents();
13+
}),
14+
);
15+
it(
16+
'should create the app',
17+
waitForAsync(() => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.componentInstance;
20+
expect(app).toBeTruthy();
21+
}),
22+
);
23+
it(
24+
`should have as title 'app'`,
25+
waitForAsync(() => {
26+
const fixture = TestBed.createComponent(AppComponent);
27+
const app = fixture.componentInstance;
28+
expect(app.title).toEqual('app');
29+
}),
30+
);
31+
it(
32+
'should render title',
33+
waitForAsync(() => {
34+
const fixture = TestBed.createComponent(AppComponent);
35+
fixture.detectChanges();
36+
const compiled = fixture.nativeElement as HTMLElement;
37+
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome to app!');
38+
}),
39+
);
2940
});
3041

3142
describe('AppComponent (initial CLI version - as it should be)', () => {

examples/example-app-v11/src/app/app.component.router.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ let router: Router;
2626
let location: SpyLocation;
2727

2828
describe('AppComponent & RouterTestingModule', () => {
29-
beforeEach(waitForAsync(() => {
30-
void TestBed.configureTestingModule({
31-
imports: [AppModule, RouterTestingModule.withRoutes(routes)],
32-
providers: [{ provide: HeroService, useClass: TestHeroService }],
33-
}).compileComponents();
34-
}));
29+
beforeEach(
30+
waitForAsync(() => {
31+
void TestBed.configureTestingModule({
32+
imports: [AppModule, RouterTestingModule.withRoutes(routes)],
33+
providers: [{ provide: HeroService, useClass: TestHeroService }],
34+
}).compileComponents();
35+
}),
36+
);
3537

3638
it('should navigate to "Dashboard" immediately', fakeAsync(() => {
3739
createComponent();

examples/example-app-v11/src/app/app.component.spec.ts

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,59 @@ let comp: AppComponent;
2121
let fixture: ComponentFixture<AppComponent>;
2222

2323
describe('AppComponent & TestModule', () => {
24-
beforeEach(waitForAsync(() => {
25-
TestBed.configureTestingModule({
26-
declarations: [
27-
AppComponent,
28-
RouterLinkDirectiveStub,
29-
BannerStubComponent,
30-
RouterOutletStubComponent,
31-
WelcomeStubComponent,
32-
],
33-
})
34-
.compileComponents()
35-
.then(() => {
36-
fixture = TestBed.createComponent(AppComponent);
37-
comp = fixture.componentInstance;
38-
});
39-
}));
24+
beforeEach(
25+
waitForAsync(() => {
26+
TestBed.configureTestingModule({
27+
declarations: [
28+
AppComponent,
29+
RouterLinkDirectiveStub,
30+
BannerStubComponent,
31+
RouterOutletStubComponent,
32+
WelcomeStubComponent,
33+
],
34+
})
35+
.compileComponents()
36+
.then(() => {
37+
fixture = TestBed.createComponent(AppComponent);
38+
comp = fixture.componentInstance;
39+
});
40+
}),
41+
);
4042
tests();
4143
});
4244

4345
describe('AppComponent & NO_ERRORS_SCHEMA', () => {
44-
beforeEach(waitForAsync(() => {
45-
TestBed.configureTestingModule({
46-
declarations: [AppComponent, BannerStubComponent, RouterLinkDirectiveStub],
47-
schemas: [NO_ERRORS_SCHEMA],
48-
})
49-
.compileComponents()
50-
.then(() => {
51-
fixture = TestBed.createComponent(AppComponent);
52-
comp = fixture.componentInstance;
53-
});
54-
}));
46+
beforeEach(
47+
waitForAsync(() => {
48+
TestBed.configureTestingModule({
49+
declarations: [AppComponent, BannerStubComponent, RouterLinkDirectiveStub],
50+
schemas: [NO_ERRORS_SCHEMA],
51+
})
52+
.compileComponents()
53+
.then(() => {
54+
fixture = TestBed.createComponent(AppComponent);
55+
comp = fixture.componentInstance;
56+
});
57+
}),
58+
);
5559
tests();
5660
});
5761

5862
describe('AppComponent & AppModule', () => {
59-
beforeEach(waitForAsync(() => {
60-
TestBed.configureTestingModule({ imports: [AppModule] })
61-
.overrideModule(AppModule, {
62-
remove: { imports: [AppRoutingModule] },
63-
add: { declarations: [RouterLinkDirectiveStub, RouterOutletStubComponent] },
64-
})
65-
.compileComponents()
66-
.then(() => {
67-
fixture = TestBed.createComponent(AppComponent);
68-
comp = fixture.componentInstance;
69-
});
70-
}));
63+
beforeEach(
64+
waitForAsync(() => {
65+
TestBed.configureTestingModule({ imports: [AppModule] })
66+
.overrideModule(AppModule, {
67+
remove: { imports: [AppRoutingModule] },
68+
add: { declarations: [RouterLinkDirectiveStub, RouterOutletStubComponent] },
69+
})
70+
.compileComponents()
71+
.then(() => {
72+
fixture = TestBed.createComponent(AppComponent);
73+
comp = fixture.componentInstance;
74+
});
75+
}),
76+
);
7177

7278
tests();
7379
});

examples/example-app-v11/src/app/banner/banner-initial.component.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ describe('BannerComponent (initial CLI generated)', () => {
77
let component: BannerComponent;
88
let fixture: ComponentFixture<BannerComponent>;
99

10-
beforeEach(waitForAsync(() => {
11-
TestBed.configureTestingModule({ declarations: [BannerComponent] }).compileComponents();
12-
}));
10+
beforeEach(
11+
waitForAsync(() => {
12+
TestBed.configureTestingModule({ declarations: [BannerComponent] }).compileComponents();
13+
}),
14+
);
1315

1416
beforeEach(() => {
1517
fixture = TestBed.createComponent(BannerComponent);

0 commit comments

Comments
 (0)