Skip to content

Commit

Permalink
chore(repo): fix craco e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Mar 17, 2023
1 parent aabd76f commit 58c4e2f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions e2e/cra-to-nx/src/cra-to-nx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ describe('nx init (for CRA)', () => {
expect(packageJson.devDependencies['@nrwl/vite']).toBeUndefined();
expect(packageJson.devDependencies['@nrwl/webpack']).toBeDefined();

runCLI(`build ${appName}`);
runCLI(`build ${appName}`, {
env: {
// since craco 7.1.0 the NODE_ENV is used, since the tests set it
// to "test" is causes an issue with React Refresh Babel
NODE_ENV: undefined,
},
});
checkFilesExist(`dist/apps/${appName}/index.html`);
});

Expand Down Expand Up @@ -104,7 +110,13 @@ describe('nx init (for CRA)', () => {

expect(craToNxOutput).toContain('🎉 Done!');

runCLI(`build ${appName}`);
runCLI(`build ${appName}`, {
env: {
// since craco 7.1.0 the NODE_ENV is used, since the tests set it
// to "test" is causes an issue with React Refresh Babel
NODE_ENV: undefined,
},
});
checkFilesExist(`dist/${appName}/index.html`);
});

Expand Down

0 comments on commit 58c4e2f

Please sign in to comment.