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:
parent
ed36c68cdb
commit
81a5ceb6d4
|
@ -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(
|
||||||
|
|
|
@ -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') &&
|
||||||
() => { expect(shx.cat('core.d.ts')).toContain(`export *`); });
|
it('should have an index d.ts file',
|
||||||
|
() => { 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,11 +90,12 @@ describe('@angular/core ng_package', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('angular metadata', () => {
|
obsoleteInIvy('metadata files are no longer needed or produced in Ivy') &&
|
||||||
|
describe('angular metadata', () => {
|
||||||
|
|
||||||
it('should have metadata.json files',
|
it('should have metadata.json files',
|
||||||
() => { expect(shx.cat('core.metadata.json')).toContain(`"__symbolic":"module"`); });
|
() => { expect(shx.cat('core.metadata.json')).toContain(`"__symbolic":"module"`); });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('fesm2015', () => {
|
describe('fesm2015', () => {
|
||||||
|
@ -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,16 +132,24 @@ 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');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have decorators',
|
if (ivyEnabled) {
|
||||||
() => { expect(shx.cat('fesm5/core.js')).toContain('__decorate'); });
|
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',
|
||||||
|
() => { 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');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have been built from the generated bundle index',
|
obsoleteInIvy('we no longer need to export private symbols') &&
|
||||||
() => { expect(shx.cat('fesm5/core.js')).toMatch('export {.*makeParamDecorator'); });
|
it('should have been built from the generated bundle index',
|
||||||
|
() => { expect(shx.cat('fesm5/core.js')).toMatch('export {.*makeParamDecorator'); });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,24 +226,21 @@ 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(
|
||||||
it('should have an \'redirect\' d.ts file in the parent dir',
|
'now that we don\'t need metadata files, we don\'t need these redirects to help resolve paths to them') &&
|
||||||
() => { expect(shx.cat('testing.d.ts')).toContain(`export *`); });
|
it('should have an \'redirect\' d.ts file in the parent dir',
|
||||||
|
() => { 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';`);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('angular metadata file', () => {
|
obsoleteInIvy('metadata files are no longer needed or produced in Ivy') &&
|
||||||
it('should have a \'redirect\' metadata.json file next to the d.ts file', () => {
|
describe('angular metadata file', () => {
|
||||||
expect(shx.cat('testing.metadata.json'))
|
it('should have a \'redirect\' metadata.json file next to the d.ts file', () => {
|
||||||
.toContain(`"exports":[{"from":"./testing/testing"}],"flatModuleIndexRedirect":true`);
|
expect(shx.cat('testing.metadata.json'))
|
||||||
});
|
.toContain(
|
||||||
});
|
`"exports":[{"from":"./testing/testing"}],"flatModuleIndexRedirect":true`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('fesm2015', () => {
|
describe('fesm2015', () => {
|
||||||
it('should have a fesm15 file in the /fesm2015 directory',
|
it('should have a fesm15 file in the /fesm2015 directory',
|
||||||
|
|
Loading…
Reference in New Issue