Skip to content

Commit

Permalink
fixup! fix(common): add upgrade sub-package to ng_package rule for @a…
Browse files Browse the repository at this point in the history
…ngular/common
  • Loading branch information
brandonroberts committed Apr 25, 2019
1 parent be06739 commit afab43e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/bazel/test/ng_package/common_package.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ describe('@angular/common ng_package', () => {
'common-testing.umd.js.map',
'common-testing.umd.min.js',
'common-testing.umd.min.js.map',
'common-upgrade.umd.js',
'common-upgrade.umd.js.map',
'common-upgrade.umd.min.js',
'common-upgrade.umd.min.js.map',
'common.umd.js',
'common.umd.js.map',
'common.umd.min.js',
Expand All @@ -69,6 +73,8 @@ describe('@angular/common ng_package', () => {
'http/testing.js.map',
'testing.js',
'testing.js.map',
'upgrade.js',
'upgrade.js.map',
];
expect(shx.ls('-R', 'fesm5').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
expect(shx.ls('-R', 'fesm2015').stdout.split('\n').filter(n => !!n).sort()).toEqual(expected);
Expand All @@ -91,6 +97,10 @@ describe('@angular/common ng_package', () => {
.toMatch('//# sourceMappingURL=testing.js.map');
expect(shx.grep('sourceMappingURL', 'fesm2015/testing.js'))
.toMatch('//# sourceMappingURL=testing.js.map');
expect(shx.grep('sourceMappingURL', 'fesm5/upgrade.js'))
.toMatch('//# sourceMappingURL=upgrade.js.map');
expect(shx.grep('sourceMappingURL', 'fesm2015/upgrade.js'))
.toMatch('//# sourceMappingURL=upgrade.js.map');
});

describe('secondary entry-point', () => {
Expand Down Expand Up @@ -129,5 +139,13 @@ describe('@angular/common ng_package', () => {
expect(actual['module']).toEqual('../../fesm5/http/testing.js');
expect(actual['typings']).toEqual('./testing.d.ts');
});
// https://github.com/angular/common-builds/blob/master/upgrade/package.json
it('/upgrade', () => {
const actual = JSON.parse(fs.readFileSync('upgrade/package.json', {encoding: 'utf-8'}));
expect(actual['main']).toEqual('../bundles/common-upgrade.umd.js');
expect(actual['es2015']).toEqual('../fesm2015/upgrade.js');
expect(actual['module']).toEqual('../fesm5/upgrade.js');
expect(actual['typings']).toEqual('./upgrade.d.ts');
});
});
});

0 comments on commit afab43e

Please sign in to comment.