build: upgrade jasmine (and related typings) to latest version (#19904)
With these changes, the types are a little stricter now and also not compatible with Protractor's jasmine-like syntax. So, we have to also use `@types/jasminewd2` for e2e tests (but not for non-e2e tests). I also had to "augment" `@types/jasminewd2`, because the latest typings from [DefinitelyTyped][1] do not reflect the fact that the `jasminewd2` version (v2.1.0) currently used by Protractor supports passing a `done` callback to a spec. [1]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/566e0394859fdc1dc893658ccec6b06372d56a91/types/jasminewd2/index.d.ts#L9-L15 Fixes #23952 Closes #24733 PR Close #19904
This commit is contained in:
committed by
Miško Hevery
parent
1e74ea9e60
commit
00c110b055
@@ -373,8 +373,8 @@ describe('ng program', () => {
|
||||
{rootNames: [path.resolve(testSupport.basePath, 'src/main.ts')], options, host});
|
||||
program.loadNgStructureAsync().then(() => {
|
||||
program.emit();
|
||||
const factory =
|
||||
fs.readFileSync(path.resolve(testSupport.basePath, 'built/src/main.ngfactory.js'));
|
||||
const ngFactoryPath = path.resolve(testSupport.basePath, 'built/src/main.ngfactory.js');
|
||||
const factory = fs.readFileSync(ngFactoryPath, 'utf8');
|
||||
expect(factory).toContain('Hello world!');
|
||||
done();
|
||||
});
|
||||
@@ -677,8 +677,9 @@ describe('ng program', () => {
|
||||
program.listLazyRoutes();
|
||||
program.emit();
|
||||
|
||||
const lazyNgFactory =
|
||||
fs.readFileSync(path.resolve(testSupport.basePath, 'built/src/lazy/lazy.ngfactory.js'));
|
||||
const ngFactoryPath = path.resolve(testSupport.basePath, 'built/src/lazy/lazy.ngfactory.js');
|
||||
const lazyNgFactory = fs.readFileSync(ngFactoryPath, 'utf8');
|
||||
|
||||
expect(lazyNgFactory).toContain('import * as i1 from "./lazy";');
|
||||
});
|
||||
|
||||
@@ -735,8 +736,10 @@ describe('ng program', () => {
|
||||
expect(normalizeRoutes(program.listLazyRoutes('src/main#MainModule'))).toEqual([
|
||||
{
|
||||
module: {name: 'MainModule', filePath: path.resolve(testSupport.basePath, 'src/main.ts')},
|
||||
referencedModule:
|
||||
{name: undefined, filePath: path.resolve(testSupport.basePath, 'src/child.ts')},
|
||||
referencedModule: {
|
||||
name: undefined as any as string, // TODO: Review use of `any` here (#19904)
|
||||
filePath: path.resolve(testSupport.basePath, 'src/child.ts')
|
||||
},
|
||||
route: './child'
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user