Skip to content

Commit

Permalink
fix(core): fix move
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Apr 11, 2023
1 parent a6b781d commit 574081c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions e2e/nx-misc/src/workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,13 +867,15 @@ describe('workspace-generator', () => {
const dryRunOutput = runCLI(
`workspace-generator ${custom} ${workspace} --no-interactive --directory=dir --skipTsConfig=true -d`
);
expect(exists(`libs/dir/${workspace}/src/index.ts`)).toEqual(false);
expect(dryRunOutput).toContain(`CREATE libs/dir/${workspace}/src/index.ts`);
expect(exists(`packages/dir/${workspace}/src/index.ts`)).toEqual(false);
expect(dryRunOutput).toContain(
`CREATE packages/dir/${workspace}/src/index.ts`
);

runCLI(
`workspace-generator ${custom} ${workspace} --no-interactive --directory=dir`
);
checkFilesExist(`libs/dir/${workspace}/src/index.ts`);
checkFilesExist(`packages/dir/${workspace}/src/index.ts`);

const jsonFailing = readJson(`tools/generators/${failing}/schema.json`);
jsonFailing.properties = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export function updateJestConfig(
if (tree.exists(jestConfigPath)) {
const oldContent = tree.read(jestConfigPath, 'utf-8');

const findName = new RegExp(`'${schema.projectName}'`, 'g');
// ensure both single and double quotes are replaced
const findName = new RegExp(
`'${schema.projectName}'|"${schema.projectName}"|\`${schema.projectName}\``,
'g'
);
const findDir = new RegExp(project.root, 'g');

const newContent = oldContent
Expand Down

0 comments on commit 574081c

Please sign in to comment.