nx/e2e/vue/src/vue-ts-solution.test.ts
Leosvel Pérez Espinosa 0d5bfe3700
fix(misc): ensure all project generators add project to workspaces config (#29582)
- Update project generators to add the project to the workspaces setup
in the new TS solution setup
- Update some library generators that were not running package
installation

<!-- 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 #
2025-01-10 13:32:16 -05:00

61 lines
1.4 KiB
TypeScript

import {
cleanupProject,
getSelectedPackageManager,
newProject,
runCLI,
uniq,
updateFile,
updateJson,
} from '@nx/e2e/utils';
describe('Vue Plugin', () => {
let proj: string;
const pm = getSelectedPackageManager();
beforeAll(() => {
proj = newProject({
packages: ['@nx/vue'],
preset: 'ts',
});
});
afterAll(() => cleanupProject());
it('should serve application in dev mode', async () => {
const app = uniq('app');
const lib = uniq('lib');
runCLI(
`generate @nx/vue:app apps/${app} --unitTestRunner=vitest --e2eTestRunner=playwright --linter=eslint`
);
runCLI(
`generate @nx/vue:lib packages/${lib} --bundler=vite --unitTestRunner=vitest --linter=eslint`
);
// app and lib generators don't have specs by default, add some stubs
updateFile(
`apps/${app}/src/foo.spec.ts`,
`
test('it should run', () => {
expect(true).toBeTruthy();
});
`
);
updateFile(
`packages/${lib}/src/foo.spec.ts`,
`
test('it should run', () => {
expect(true).toBeTruthy();
});
`
);
expect(() => runCLI(`lint ${app}`)).not.toThrow();
expect(() => runCLI(`test ${app}`)).not.toThrow();
expect(() => runCLI(`build ${app}`)).not.toThrow();
expect(() => runCLI(`lint ${lib}`)).not.toThrow();
expect(() => runCLI(`test ${lib}`)).not.toThrow();
expect(() => runCLI(`build ${lib}`)).not.toThrow();
}, 300_000);
});