Skip to content

Commit ed08d83

Browse files
alan-agius4clydin
authored andcommitted
test: use correct version of material
Previously, the latest version was being installed which caused E2E to fail.
1 parent 4d723ca commit ed08d83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/legacy-cli/e2e/tests/build/material.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import { SemVer } from 'semver';
12
import { getGlobalVariable } from '../../utils/env';
23
import { replaceInFile } from '../../utils/fs';
34
import { installPackage, installWorkspacePackages } from '../../utils/packages';
45
import { ng } from '../../utils/process';
56
import { isPrereleaseCli, updateJsonFile } from '../../utils/project';
7+
import { readNgVersion } from '../../utils/version';
68

79
const snapshots = require('../../ng-snapshot/package.json');
810

911
export default async function () {
10-
const tag = await isPrereleaseCli() ? '@next' : '';
12+
const tag = (await isPrereleaseCli()) ? '@next' : `@${new SemVer(readNgVersion()).major}`;
1113
await ng('add', `@angular/material${tag}`, '--skip-confirmation');
1214

1315
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
@@ -28,7 +30,7 @@ export default async function () {
2830

2931
await installWorkspacePackages();
3032
} else {
31-
await installPackage('@angular/material-moment-adapter');
33+
await installPackage(`@angular/material-moment-adapter${tag}`);
3234
}
3335

3436
await installPackage('moment');

0 commit comments

Comments
 (0)