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:
parent
e920eac026
commit
d3edc5c0f5
|
@ -29,7 +29,7 @@ class ExampleBoilerPlate {
|
||||||
'Perhaps you need to run "yarn example-use-npm" or "yarn example-use-local" to install the dependencies?');
|
'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 => {
|
exampleFolders.forEach(exampleFolder => {
|
||||||
const exampleConfig = this.loadJsonFile(path.resolve(exampleFolder, EXAMPLE_CONFIG_FILENAME));
|
const exampleConfig = this.loadJsonFile(path.resolve(exampleFolder, EXAMPLE_CONFIG_FILENAME));
|
||||||
|
|
|
@ -23,7 +23,7 @@ describe('example-boilerplate tool', () => {
|
||||||
it('should run `ngcc`', () => {
|
it('should run `ngcc`', () => {
|
||||||
exampleBoilerPlate.add();
|
exampleBoilerPlate.add();
|
||||||
expect(shelljs.exec).toHaveBeenCalledWith(
|
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', () => {
|
it('should process all the example folders', () => {
|
||||||
|
|
|
@ -171,7 +171,13 @@ function runE2eTestsSystemJS(appDir, outputFile) {
|
||||||
const appBuildSpawnInfo = spawnExt('yarn', [config.build], {cwd: appDir});
|
const appBuildSpawnInfo = spawnExt('yarn', [config.build], {cwd: appDir});
|
||||||
const appRunSpawnInfo = spawnExt('yarn', [config.run, '-s'], {cwd: appDir}, true);
|
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) {
|
function runProtractorSystemJS(prepPromise, appDir, appRunSpawnInfo, outputFile) {
|
||||||
|
|
Loading…
Reference in New Issue