From 9c67a8a6593c2d277f402c5a8ffebf46f635b465 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 11 Apr 2023 18:36:06 +0300 Subject: [PATCH] feat(rspack): simplify app generator (#212) Co-Author: Douglas Machado --- tests/rspack.spec.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/rspack.spec.ts b/tests/rspack.spec.ts index 66ca918736..1ade9fda4b 100644 --- a/tests/rspack.spec.ts +++ b/tests/rspack.spec.ts @@ -27,17 +27,14 @@ describe('rspack e2e', () => { it('should create rspack root project and additional apps', async () => { const project = uniq('myapp'); await runNxCommandAsync( - `generate @nrwl/rspack:preset ${project} --unitTestRunner=jest --e2eTestRunner=cypress` + `generate @nrwl/rspack:preset ${project} --framework=react --unitTestRunner=jest --e2eTestRunner=cypress` ); let result = await runNxCommandAsync(`build ${project}`, { env: { NODE_ENV: 'production' }, }); expect(result.stdout).toContain('Successfully ran target build'); // Make sure expected files are present. - expect(listFiles(`dist/${project}`)).toHaveLength(5); - - result = await runNxCommandAsync(`lint ${project}`); - expect(result.stdout).toContain('Successfully ran target lint'); + expect(listFiles(`dist/${project}`)).toHaveLength(4); result = await runNxCommandAsync(`test ${project}`); expect(result.stdout).toContain('Successfully ran target test'); @@ -54,12 +51,12 @@ describe('rspack e2e', () => { env: { NODE_ENV: 'production' }, }); expect(result.stdout).toContain('Successfully ran target build'); - expect(listFiles(`dist/${project}`)).toHaveLength(5); // same length as before + expect(listFiles(`dist/${project}`)).toHaveLength(4); // same length as before // Generate a new app and check that the files are correct const app2 = uniq('app2'); await runNxCommandAsync( - `generate @nrwl/rspack:app ${app2} --unitTestRunner=jest --e2eTestRunner=cypress --style=css` + `generate @nrwl/rspack:app ${app2} --framework=react --unitTestRunner=jest --e2eTestRunner=cypress --style=css` ); checkFilesExist(`${app2}/project.json`, `${app2}-e2e/project.json`); result = await runNxCommandAsync(`build ${app2}`, { @@ -67,15 +64,12 @@ describe('rspack e2e', () => { }); expect(result.stdout).toContain('Successfully ran target build'); // Make sure expected files are present. - expect(listFiles(`dist/${app2}`)).toHaveLength(5); - - result = await runNxCommandAsync(`lint ${app2}`); - expect(result.stdout).toContain('Successfully ran target lint'); + expect(listFiles(`dist/${app2}`)).toHaveLength(4); result = await runNxCommandAsync(`test ${app2}`); expect(result.stdout).toContain('Successfully ran target test'); result = await runNxCommandAsync(`e2e ${app2}-e2e`); expect(result.stdout).toContain('Successfully ran target e2e'); - }, 120_000); + }, 200_000); });