chore(react): add rspack bundler test
This commit is contained in:
parent
c544a34c2b
commit
392b4b82bc
@ -63,6 +63,41 @@ describe('React Applications', () => {
|
|||||||
}
|
}
|
||||||
}, 250_000);
|
}, 250_000);
|
||||||
|
|
||||||
|
it('should be able to use Rspack to build and test apps', async () => {
|
||||||
|
const appName = uniq('app');
|
||||||
|
const libName = uniq('lib');
|
||||||
|
|
||||||
|
runCLI(
|
||||||
|
`generate @nx/react:app ${appName} --bundler=rspack --unit-test-runner=vitest --no-interactive --skipFormat`
|
||||||
|
);
|
||||||
|
runCLI(
|
||||||
|
`generate @nx/react:lib ${libName} --bundler=none --no-interactive --unit-test-runner=vitest --skipFormat`
|
||||||
|
);
|
||||||
|
|
||||||
|
// Library generated with Vite
|
||||||
|
checkFilesExist(`libs/${libName}/vite.config.ts`);
|
||||||
|
|
||||||
|
const mainPath = `apps/${appName}/src/main.tsx`;
|
||||||
|
updateFile(
|
||||||
|
mainPath,
|
||||||
|
`
|
||||||
|
import '@${proj}/${libName}';
|
||||||
|
${readFile(mainPath)}
|
||||||
|
`
|
||||||
|
);
|
||||||
|
|
||||||
|
runCLI(`build ${appName}`);
|
||||||
|
|
||||||
|
checkFilesExist(`dist/apps/${appName}/index.html`);
|
||||||
|
|
||||||
|
if (runE2ETests()) {
|
||||||
|
// TODO(Colum): investigate why webkit is failing
|
||||||
|
const e2eResults = runCLI(`e2e ${appName}-e2e --project=chromium`);
|
||||||
|
expect(e2eResults).toContain('Successfully ran target e2e for project');
|
||||||
|
expect(await killPorts()).toBeTruthy();
|
||||||
|
}
|
||||||
|
}, 250_000);
|
||||||
|
|
||||||
it('should be able to generate a react app + lib (with CSR and SSR)', async () => {
|
it('should be able to generate a react app + lib (with CSR and SSR)', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user