fix(nx-plugin): e2e utils should work (#15397)
This commit is contained in:
parent
76fcf7a319
commit
a4a9c27637
@ -73,14 +73,12 @@ describe('Nx Plugin', () => {
|
||||
// doesn't use the collection we are building
|
||||
// we should change it to point to the right collection using relative path
|
||||
// TODO: Re-enable this to work with pnpm
|
||||
xit(`should run the plugin's e2e tests`, async () => {
|
||||
if (isNotWindows()) {
|
||||
const plugin = uniq('plugin-name');
|
||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
||||
const e2eResults = runCLI(`e2e ${plugin}-e2e`);
|
||||
expect(e2eResults).toContain('Successfully ran target e2e');
|
||||
expect(await killPorts()).toBeTruthy();
|
||||
}
|
||||
it(`should run the plugin's e2e tests`, async () => {
|
||||
const plugin = uniq('plugin-name');
|
||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
||||
const e2eResults = runCLI(`e2e ${plugin}-e2e`);
|
||||
expect(e2eResults).toContain('Successfully ran target e2e');
|
||||
expect(await killPorts()).toBeTruthy();
|
||||
}, 250000);
|
||||
|
||||
it('should be able to generate a migration', async () => {
|
||||
|
||||
@ -43,7 +43,7 @@ export function runNxCommandAsync(
|
||||
silenceError: false,
|
||||
}
|
||||
): Promise<{ stdout: string; stderr: string }> {
|
||||
if (fileExists('package.json')) {
|
||||
if (fileExists(tmpProjPath('package.json'))) {
|
||||
const pmc = getPackageManagerCommand();
|
||||
return runCommandAsync(`${pmc.exec} nx ${command}`, opts);
|
||||
} else if (process.platform === 'win32') {
|
||||
|
||||
@ -21,7 +21,7 @@ export function runNxCommand(
|
||||
cwd: tmpProjPath(),
|
||||
env: { ...process.env, ...opts.env },
|
||||
};
|
||||
if (fileExists('package.json')) {
|
||||
if (fileExists(tmpProjPath('package.json'))) {
|
||||
const pmc = getPackageManagerCommand();
|
||||
return execSync(`${pmc.exec} nx ${command}`, execSyncOptions);
|
||||
} else if (process.platform === 'win32') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user