test(docs-infra): run all example tests in IVY runtime (#41638)

We have several tests which use system.js, this means that we cannot use NGCC with `--create-ivy-entry-points`, also we need to process UMD bundles since our system.js configurations use UMDs.

PR Close #41638
This commit is contained in:
Alan Agius 2021-04-16 14:57:26 +02:00 committed by Andrew Kushnir
parent e920eac026
commit d3edc5c0f5
3 changed files with 9 additions and 3 deletions

View File

@ -29,7 +29,7 @@ class ExampleBoilerPlate {
'Perhaps you need to run "yarn example-use-npm" or "yarn example-use-local" to install the dependencies?');
}
shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`);
shelljs.exec(`yarn --cwd ${SHARED_PATH} ngcc --properties es2015 main`);
exampleFolders.forEach(exampleFolder => {
const exampleConfig = this.loadJsonFile(path.resolve(exampleFolder, EXAMPLE_CONFIG_FILENAME));

View File

@ -23,7 +23,7 @@ describe('example-boilerplate tool', () => {
it('should run `ngcc`', () => {
exampleBoilerPlate.add();
expect(shelljs.exec).toHaveBeenCalledWith(
`yarn --cwd ${sharedDir} ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points`);
`yarn --cwd ${sharedDir} ngcc --properties es2015 main`);
});
it('should process all the example folders', () => {

View File

@ -171,7 +171,13 @@ function runE2eTestsSystemJS(appDir, outputFile) {
const appBuildSpawnInfo = spawnExt('yarn', [config.build], {cwd: appDir});
const appRunSpawnInfo = spawnExt('yarn', [config.run, '-s'], {cwd: appDir}, true);
return runProtractorSystemJS(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
let run = runProtractorSystemJS(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
if (fs.existsSync(appDir + '/aot/index.html')) {
run = run.then((ok) => ok && runProtractorAoT(appDir, outputFile));
}
return run;
}
function runProtractorSystemJS(prepPromise, appDir, appRunSpawnInfo, outputFile) {