Skip to content

Commit ea5c215

Browse files
committed
test: use project e2e schematic during E2E project setup
Previously, the globally installed CLI's schematic was used to setup E2E testing in the generated project used for testing. By using the project's schematic, the generated project becomes more representative of a user's project.
1 parent 399d8e7 commit ea5c215

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/legacy-cli/e2e/utils/project.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,21 @@ export async function prepareProjectForE2e(name) {
3333
await git('config', 'user.name', 'Angular CLI E2e');
3434
await git('config', 'commit.gpgSign', 'false');
3535

36-
await ng('generate', '@schematics/angular:e2e', '--related-app-name', name);
36+
if (argv['ng-snapshots'] || argv['ng-tag']) {
37+
await useSha();
38+
}
39+
40+
console.log(`Project ${name} created... Installing packages.`);
41+
await installWorkspacePackages();
42+
43+
await ng('generate', 'e2e', '--related-app-name', name);
3744

3845
await useCIChrome('e2e');
3946
await useCIChrome('');
4047

4148
// legacy projects
4249
await useCIChrome('src');
4350

44-
if (argv['ng-snapshots'] || argv['ng-tag']) {
45-
await useSha();
46-
}
47-
48-
console.log(`Project ${name} created... Installing npm.`);
49-
await installWorkspacePackages();
5051
await useCIDefaults(name);
5152
// Force sourcemaps to be from the root of the filesystem.
5253
await updateJsonFile('tsconfig.json', (json) => {

0 commit comments

Comments
 (0)