From b288abd137705b5c4d53f154f7f66ef226815a57 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Wed, 24 Apr 2019 22:08:29 -0400 Subject: [PATCH] fix(nx): fix affected params interpolation --- e2e/schematics/affected.test.ts | 6 ++++-- packages/schematics/src/command-line/affected.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/e2e/schematics/affected.test.ts b/e2e/schematics/affected.test.ts index af796f6409f19..4e261a05bf738 100644 --- a/e2e/schematics/affected.test.ts +++ b/e2e/schematics/affected.test.ts @@ -200,8 +200,10 @@ describe('Affected', () => { expect(i18n).toContain(`Running extract-i18n for ${myapp}`); const interpolatedTests = runCommand( - `npm run affected -- --target test --files="libs/${mylib}/src/index.ts" -- --jest-config {project.root}jest.config.js` + `npm run affected -- --target test --files="libs/${mylib}/src/index.ts" -- --jest-config {project.root}/jest.config.js` + ); + expect(interpolatedTests).toContain( + `Running test for affected projects succeeded.` ); - expect(interpolatedTests).toContain(`Running test for ${mylib}`); }, 1000000); }); diff --git a/packages/schematics/src/command-line/affected.ts b/packages/schematics/src/command-line/affected.ts index 32b31dcb524d2..f01c2771de8e9 100644 --- a/packages/schematics/src/command-line/affected.ts +++ b/packages/schematics/src/command-line/affected.ts @@ -264,7 +264,7 @@ function transformArgs( ) { return args.map(arg => { const regex = /{project\.([^}]+)}/g; - arg.replace(regex, (_, group: string) => { + return arg.replace(regex, (_, group: string) => { if (group.includes('.')) { throw new Error('Only top-level properties can be interpolated'); }