<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # --------- Co-authored-by: Colum Ferry <cferry09@gmail.com> Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import { newProject, runCLI, runCLIAsync, uniq } from '@nx/e2e/utils';
|
|
|
|
describe('Jest root projects', () => {
|
|
const myapp = uniq('myapp');
|
|
const mylib = uniq('mylib');
|
|
|
|
describe('angular', () => {
|
|
beforeAll(() => {
|
|
newProject({
|
|
packages: ['@nx/angular'],
|
|
});
|
|
runCLI(
|
|
`generate @nx/angular:app --name=${myapp} --directory . --rootProject --no-interactive`
|
|
);
|
|
});
|
|
|
|
it('should test root level app projects', async () => {
|
|
expect(() => runCLI(`test ${myapp}`)).not.toThrow();
|
|
}, 300_000);
|
|
|
|
it('should add lib project and tests should still work', async () => {
|
|
runCLI(`generate @nx/angular:lib ${mylib} --no-interactive`);
|
|
|
|
expect(() => runCLI(`test ${mylib}`)).not.toThrow();
|
|
expect(() => runCLI(`test ${myapp}`)).not.toThrow();
|
|
}, 300_000);
|
|
});
|
|
|
|
describe('react', () => {
|
|
beforeAll(() => {
|
|
newProject({
|
|
packages: ['@nx/react'],
|
|
});
|
|
runCLI(
|
|
`generate @nx/react:app --name=${myapp} --directory . --rootProject`
|
|
);
|
|
});
|
|
|
|
it('should test root level app projects', async () => {
|
|
expect(() => runCLI(`test ${myapp}`)).not.toThrow();
|
|
}, 300_000);
|
|
|
|
it('should add lib project and tests should still work', async () => {
|
|
runCLI(`generate @nx/react:lib ${mylib} --unitTestRunner=jest`);
|
|
|
|
expect(() => runCLI(`test ${mylib}`)).not.toThrow();
|
|
expect(() => runCLI(`test ${myapp}`)).not.toThrow();
|
|
}, 300_000);
|
|
});
|
|
});
|