Skip to content

Commit d304133

Browse files
AgentEnderFrozenPandaz
authored andcommitted
fix(nx-plugin): e2e utils should work (#15397)
(cherry picked from commit a4a9c27)
1 parent 0761e4c commit d304133

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

e2e/nx-plugin/src/nx-plugin.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ describe('Nx Plugin', () => {
7373
// doesn't use the collection we are building
7474
// we should change it to point to the right collection using relative path
7575
// TODO: Re-enable this to work with pnpm
76-
xit(`should run the plugin's e2e tests`, async () => {
77-
if (isNotWindows()) {
78-
const plugin = uniq('plugin-name');
79-
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
80-
const e2eResults = runCLI(`e2e ${plugin}-e2e`);
81-
expect(e2eResults).toContain('Successfully ran target e2e');
82-
expect(await killPorts()).toBeTruthy();
83-
}
76+
it(`should run the plugin's e2e tests`, async () => {
77+
const plugin = uniq('plugin-name');
78+
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
79+
const e2eResults = runCLI(`e2e ${plugin}-e2e`);
80+
expect(e2eResults).toContain('Successfully ran target e2e');
81+
expect(await killPorts()).toBeTruthy();
8482
}, 250000);
8583

8684
it('should be able to generate a migration', async () => {

packages/nx-plugin/src/utils/testing-utils/async-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function runNxCommandAsync(
4343
silenceError: false,
4444
}
4545
): Promise<{ stdout: string; stderr: string }> {
46-
if (fileExists('package.json')) {
46+
if (fileExists(tmpProjPath('package.json'))) {
4747
const pmc = getPackageManagerCommand();
4848
return runCommandAsync(`${pmc.exec} nx ${command}`, opts);
4949
} else if (process.platform === 'win32') {

packages/nx-plugin/src/utils/testing-utils/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function runNxCommand(
2121
cwd: tmpProjPath(),
2222
env: { ...process.env, ...opts.env },
2323
};
24-
if (fileExists('package.json')) {
24+
if (fileExists(tmpProjPath('package.json'))) {
2525
const pmc = getPackageManagerCommand();
2626
return execSync(`${pmc.exec} nx ${command}`, execSyncOptions);
2727
} else if (process.platform === 'win32') {

0 commit comments

Comments
 (0)