fix(node): quote filepath in cli e2e sample test (#14779)
Fixes https://github.com/nrwl/nx/issues/14761
This commit is contained in:
parent
259d4b29cf
commit
bc788ff876
@ -38,4 +38,33 @@ describe('e2eProjectGenerator', () => {
|
||||
|
||||
expect(tree.exists(`e2e/src/server/server.spec.ts`)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should generate cli project', async () => {
|
||||
await applicationGenerator(tree, {
|
||||
name: 'api',
|
||||
framework: 'none',
|
||||
e2eTestRunner: 'none',
|
||||
});
|
||||
await e2eProjectGenerator(tree, {
|
||||
projectType: 'cli',
|
||||
project: 'api',
|
||||
});
|
||||
expect(tree.read('api-e2e/src/api/api.spec.ts', 'utf-8'))
|
||||
.toMatchInlineSnapshot(`
|
||||
"import { execSync } from 'child_process';
|
||||
import { join } from 'path';
|
||||
|
||||
describe('CLI tests', () => {
|
||||
it('should print a message', () => {
|
||||
const cliPath = join(process.cwd(), \\"dist/api\\");
|
||||
|
||||
const output = execSync(\`node \${cliPath}\`).toString();
|
||||
|
||||
expect(output).toMatch(/Hello World/);
|
||||
});
|
||||
});
|
||||
|
||||
"
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
@ -3,7 +3,7 @@ import { join } from 'path';
|
||||
|
||||
describe('CLI tests', () => {
|
||||
it('should print a message', () => {
|
||||
const cliPath = join(process.cwd(), <%= mainFile %>);
|
||||
const cliPath = join(process.cwd(), "<%= mainFile %>");
|
||||
|
||||
const output = execSync(`node ${cliPath}`).toString();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user