Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qol #13930

Merged
merged 2 commits into from Mar 15, 2019
Merged

Qol #13930

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,6 +8,7 @@

import { Architect } from '@angular-devkit/architect/src/index2';
import { TestLogger } from '@angular-devkit/architect/testing';
import { logging } from '@angular-devkit/core';
import { browserBuild, createArchitect, host } from '../utils';


Expand Down Expand Up @@ -121,7 +122,12 @@ describe('Browser Builder scripts array', () => {
it('chunk in entry', async () => {
host.writeMultipleFiles(scripts);

const logger = new TestLogger('build-script-chunk-entry');
const logger = new logging.Logger('build-script-chunk-entry');
const logs: string[] = [];
logger.subscribe(({ message }) => {
logs.push(message);
});

await browserBuild(
architect,
host,
Expand All @@ -132,9 +138,8 @@ describe('Browser Builder scripts array', () => {
{ logger },
);

const validate = ` [entry] [rendered]`;
expect(logger.includes(`(lazy-script) 69 bytes${validate}`)).toBe(true);
expect(logger.includes(`(renamed-script) 78 bytes${validate}`)).toBe(true);
expect(logger.includes(`(renamed-lazy-script) 88 bytes${validate}`)).toBe(true);
expect(logs.join('\n')).toMatch(/\(lazy-script\) 69 bytes.*\[entry].*\[rendered]/);
expect(logs.join('\n')).toMatch(/\(renamed-script\) 78 bytes.*\[entry].*\[rendered]/);
expect(logs.join('\n')).toMatch(/\(renamed-lazy-script\) 88 bytes.*\[entry].*\[rendered]/);
});
});
5 changes: 5 additions & 0 deletions scripts/test.ts
Expand Up @@ -250,6 +250,11 @@ export default function (args: ParsedArgs, logger: logging.Logger) {
}));

logger.info(`Found ${tests.length} spec files, out of ${allTests.length}.`);

if (tests.length === 0) {
logger.info('No test to run, exiting... You might want to rerun with "--full".');
process.exit('CI' in process.env ? 1 : 0);
}
}
}

Expand Down