test(ivy): add/remove fixmes with root causes for packages/bazel/test/ng_package:core_package (#27302)

PR Close #27302
This commit is contained in:
Igor Minar 2018-11-27 14:43:47 -08:00
parent ed36c68cdb
commit 81a5ceb6d4
2 changed files with 39 additions and 30 deletions

View File

@ -12,6 +12,7 @@ ts_library(
srcs = ["core_package.spec.ts"], srcs = ["core_package.spec.ts"],
deps = [ deps = [
"//packages:types", "//packages:types",
"//packages/private/testing",
"@ngdeps//@types/shelljs", "@ngdeps//@types/shelljs",
], ],
) )
@ -24,9 +25,6 @@ jasmine_node_test(
"@ngdeps//@types/shelljs", "@ngdeps//@types/shelljs",
"@ngdeps//shelljs", "@ngdeps//shelljs",
], ],
tags = [
"fixme-ivy-aot",
],
) )
ts_library( ts_library(

View File

@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {fixmeIvy, ivyEnabled, obsoleteInIvy} from '@angular/private/testing';
import * as path from 'path'; import * as path from 'path';
import * as shx from 'shelljs'; import * as shx from 'shelljs';
@ -73,8 +74,10 @@ describe('@angular/core ng_package', () => {
describe('typescript support', () => { describe('typescript support', () => {
it('should have an index.d.ts file', fixmeIvy('FW-738: ngtsc doesn\'t generate flat index files') &&
it('should have an index d.ts file',
() => { expect(shx.cat('core.d.ts')).toContain(`export *`); }); () => { expect(shx.cat('core.d.ts')).toContain(`export *`); });
it('should not have amd module names', it('should not have amd module names',
() => { expect(shx.cat('public_api.d.ts')).not.toContain('<amd-module name'); }); () => { expect(shx.cat('public_api.d.ts')).not.toContain('<amd-module name'); });
}); });
@ -87,6 +90,7 @@ describe('@angular/core ng_package', () => {
}); });
obsoleteInIvy('metadata files are no longer needed or produced in Ivy') &&
describe('angular metadata', () => { describe('angular metadata', () => {
it('should have metadata.json files', it('should have metadata.json files',
@ -108,8 +112,10 @@ describe('@angular/core ng_package', () => {
.toMatch(/@license Angular v\d+\.\d+\.\d+(?!-PLACEHOLDER)/); .toMatch(/@license Angular v\d+\.\d+\.\d+(?!-PLACEHOLDER)/);
}); });
it('should have been built from the generated bundle index', obsoleteInIvy('we no longer need to export private symbols') &&
() => { expect(shx.cat('fesm2015/core.js')).toMatch('export {.*makeParamDecorator'); }); it('should have been built from the generated bundle index', () => {
expect(shx.cat('fesm2015/core.js')).toMatch('export {.*makeParamDecorator');
});
}); });
@ -126,14 +132,22 @@ describe('@angular/core ng_package', () => {
expect(shx.cat('fesm5/core.js')).not.toContain('@fileoverview added by tsickle'); expect(shx.cat('fesm5/core.js')).not.toContain('@fileoverview added by tsickle');
}); });
if (ivyEnabled) {
it('should have decorators downleveled to static props e.g. ngInjectableDef', () => {
expect(shx.cat('fesm5/core.js')).not.toContain('__decorate');
expect(shx.cat('fesm5/core.js')).toContain('.ngInjectableDef = ');
});
} else {
it('should have decorators', it('should have decorators',
() => { expect(shx.cat('fesm5/core.js')).toContain('__decorate'); }); () => { expect(shx.cat('fesm5/core.js')).toContain('__decorate'); });
}
it('should load tslib from external bundle', () => { it('should load tslib from external bundle', () => {
expect(shx.cat('fesm5/core.js')).not.toContain('function __extends'); expect(shx.cat('fesm5/core.js')).not.toContain('function __extends');
expect(shx.cat('fesm5/core.js')).toMatch('import {.*__extends'); expect(shx.cat('fesm5/core.js')).toMatch('import {.*__extends');
}); });
obsoleteInIvy('we no longer need to export private symbols') &&
it('should have been built from the generated bundle index', it('should have been built from the generated bundle index',
() => { expect(shx.cat('fesm5/core.js')).toMatch('export {.*makeParamDecorator'); }); () => { expect(shx.cat('fesm5/core.js')).toMatch('export {.*makeParamDecorator'); });
}); });
@ -212,22 +226,19 @@ describe('@angular/core ng_package', () => {
const typingsFile = p `testing/index.d.ts`; const typingsFile = p `testing/index.d.ts`;
it('should have a typings file', it('should have a typings file',
() => { expect(shx.cat(typingsFile)).toContain('export * from \'./public_api\';'); }); () => { expect(shx.cat(typingsFile)).toContain('export * from \'./public_api\';'); });
});
describe('typescript support', () => {
// TODO(i): why in the parent dir? obsoleteInIvy(
'now that we don\'t need metadata files, we don\'t need these redirects to help resolve paths to them') &&
it('should have an \'redirect\' d.ts file in the parent dir', it('should have an \'redirect\' d.ts file in the parent dir',
() => { expect(shx.cat('testing.d.ts')).toContain(`export *`); }); () => { expect(shx.cat('testing.d.ts')).toContain(`export *`); });
it('should have a \'actual\' d.ts file in the parent dir', () => {
expect(shx.cat('testing/index.d.ts')).toContain(`export * from './public_api';`);
});
}); });
obsoleteInIvy('metadata files are no longer needed or produced in Ivy') &&
describe('angular metadata file', () => { describe('angular metadata file', () => {
it('should have a \'redirect\' metadata.json file next to the d.ts file', () => { it('should have a \'redirect\' metadata.json file next to the d.ts file', () => {
expect(shx.cat('testing.metadata.json')) expect(shx.cat('testing.metadata.json'))
.toContain(`"exports":[{"from":"./testing/testing"}],"flatModuleIndexRedirect":true`); .toContain(
`"exports":[{"from":"./testing/testing"}],"flatModuleIndexRedirect":true`);
}); });
}); });