Skip to content

Commit 76f8958

Browse files
committed
test: support prelease versions in platform server E2E
The `@nguniversal/express-engine` package was previously not added with a prelease version taken into account. Now when the CLI is in a prelease state, the package will be added using the prelease `next` tag.
1 parent 18fdb01 commit 76f8958

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/legacy-cli/e2e/tests/build/platform-server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { normalize } from 'path';
22
import { getGlobalVariable } from '../../utils/env';
33
import { appendToFile, expectFileToMatch, writeFile } from '../../utils/fs';
44
import { exec, ng, silentNpm } from '../../utils/process';
5-
import { updateJsonFile } from '../../utils/project';
5+
import { isPrereleaseCli, updateJsonFile } from '../../utils/project';
66

77
const snapshots = require('../../ng-snapshot/package.json');
88

@@ -12,15 +12,16 @@ export default async function () {
1212

1313
// @nguniversal/express-engine currently relies on ^0.1000.0 of @angular-devkit/architect
1414
// which is not present in the local package registry and not semver compatible with 0.1001.0+
15-
const { stdout: stdout1 } = await silentNpm('pack', '@angular-devkit/architect@0.1000', '--registry=https://registry.npmjs.org');
15+
const { stdout: stdout1 } = await silentNpm('pack', '@angular-devkit/architect@0.1001', '--registry=https://registry.npmjs.org');
1616
await silentNpm('publish', stdout1.trim(), '--registry=http://localhost:4873', '--tag=minor');
1717

1818
// @nguniversal/express-engine currently relies on ^10.0.0 of @angular-devkit/core
1919
// which is not present in the local package registry and not semver compatible prerelease version of 10.1.0
20-
const { stdout: stdout2 } = await silentNpm('pack', '@angular-devkit/core@10.0', '--registry=https://registry.npmjs.org');
20+
const { stdout: stdout2 } = await silentNpm('pack', '@angular-devkit/core@10.1', '--registry=https://registry.npmjs.org');
2121
await silentNpm('publish', stdout2.trim(), '--registry=http://localhost:4873', '--tag=minor');
2222

23-
await ng('add', '@nguniversal/express-engine');
23+
const tag = (await isPrereleaseCli()) ? 'next' : 'latest';
24+
await ng('add', `@nguniversal/express-engine@${tag}`);
2425

2526
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
2627
if (isSnapshotBuild) {

0 commit comments

Comments
 (0)