build: update jasmine to 3.5 (#34625)
1. update jasmine to 3.5 2. update @types/jasmine to 3.5 3. update @types/jasminewd2 to 2.0.8 Also fix several cases, the new jasmine 3 will help to create test cases correctly, such as in the `jasmine 2.x` version, the following case will pass ``` expect(1 == 2); ``` But in jsamine 3, the case will need to be ``` expect(1 == 2).toBeTrue(); ``` PR Close #34625
This commit is contained in:

committed by
Kara Erickson

parent
52ab9397a0
commit
b28a5f6eef
@ -1559,11 +1559,13 @@ describe('ngc transformer command-line', () => {
|
||||
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
const timerToken = 100;
|
||||
spyOn(ts.sys, 'setTimeout').and.callFake((callback: () => void) => {
|
||||
// TODO: @JiaLiPassion, need to wait @types/jasmine to handle optional method case
|
||||
spyOn(ts.sys as any, 'setTimeout').and.callFake((callback: () => void) => {
|
||||
timer = callback;
|
||||
return timerToken;
|
||||
});
|
||||
spyOn(ts.sys, 'clearTimeout').and.callFake((token: number) => {
|
||||
// TODO: @JiaLiPassion, need to wait @types/jasmine to handle optional method case
|
||||
spyOn(ts.sys as any, 'clearTimeout').and.callFake((token: number) => {
|
||||
if (token == timerToken) {
|
||||
timer = undefined;
|
||||
}
|
||||
@ -2323,17 +2325,17 @@ describe('ngc transformer command-line', () => {
|
||||
}));
|
||||
write('lib1/index.ts', `
|
||||
import {Directive} from '@angular/core';
|
||||
|
||||
|
||||
@Directive()
|
||||
export class BaseClass {}
|
||||
`);
|
||||
write('index.ts', `
|
||||
import {NgModule, Directive} from '@angular/core';
|
||||
import {BaseClass} from 'lib1_built';
|
||||
|
||||
|
||||
@Directive({selector: 'my-dir'})
|
||||
export class MyDirective extends BaseClass {}
|
||||
|
||||
|
||||
@NgModule({declarations: [MyDirective]})
|
||||
export class AppModule {}
|
||||
`);
|
||||
|
Reference in New Issue
Block a user