Skip to content

Commit

Permalink
test: adjust e2e tests to as-provided configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Bielik20 committed Sep 11, 2023
1 parent f76b543 commit a012760
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions e2e/nx-jest-playwright-e2e/tests/nx-jest-playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('nx-jest-playwright e2e', () => {
await runNxCommandAsync(
`generate @ns3/nx-jest-playwright:project ${plugin} --directory subdir`,
);
expect(() => checkFilesExist(`apps/subdir/${plugin}/src/app.spec.ts`)).not.toThrow();
expect(() => checkFilesExist(`subdir/${plugin}/src/app.spec.ts`)).not.toThrow();
});
});

Expand All @@ -35,7 +35,7 @@ describe('nx-jest-playwright e2e', () => {
await runNxCommandAsync(
`generate @ns3/nx-jest-playwright:project ${plugin} --tags e2etag,e2ePackage`,
);
const projectJson = readJson(`apps/${plugin}/project.json`);
const projectJson = readJson(`${plugin}/project.json`);
expect(projectJson.tags).toEqual(['e2etag', 'e2ePackage']);
});
});
Expand Down
4 changes: 2 additions & 2 deletions e2e/nx-playwright-e2e/tests/nx-playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('nx-playwright e2e', () => {
const project = uniq('nx-playwright');
await runNxCommandAsync(`generate @ns3/nx-playwright:project ${project} --directory subdir`);

assert.doesNotThrow(() => checkFilesExist(`apps/subdir/${project}/tests/app.spec.ts`));
assert.doesNotThrow(() => checkFilesExist(`subdir/${project}/tests/app.spec.ts`));
});
});

Expand All @@ -63,7 +63,7 @@ describe('nx-playwright e2e', () => {
await runNxCommandAsync(
`generate @ns3/nx-playwright:project ${projectName} --tags e2etag,e2ePackage`,
);
const project = readJson(`apps/${projectName}/project.json`);
const project = readJson(`${projectName}/project.json`);

assert.deepEqual(project.tags, ['e2etag', 'e2ePackage']);
});
Expand Down
4 changes: 2 additions & 2 deletions e2e/nx-serverless-e2e/tests/serverless.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ describe('serverless e2e', () => {
await runNxCommandAsync(
`generate @ns3/nx-serverless:application ${plugin} --directory subdir --tags e2etag,e2ePackage --plugin @ns3/nx-serverless/plugin`,
);
const projectJson = readJson(`apps/subdir/${plugin}/project.json`);
const projectJson = readJson(`subdir/${plugin}/project.json`);
expect(projectJson.tags).toEqual(['e2etag', 'e2ePackage']);
expect(() => checkFilesExist(`apps/subdir/${plugin}/src/handlers/foo.ts`)).not.toThrow();
expect(() => checkFilesExist(`subdir/${plugin}/src/handlers/foo.ts`)).not.toThrow();
});
});
});
2 changes: 1 addition & 1 deletion packages/nx-core/src/testing-utils/run-nx-new-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function runNxNewCommand(args?: string, silent?: boolean) {
return execSync(
`node ${require.resolve(
'nx',
)} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=empty ${
)} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=apps ${
args || ''
}`,
{
Expand Down

0 comments on commit a012760

Please sign in to comment.