Skip to content

Commit

Permalink
feat(core): check for npm vulnerabilities when creating a new workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Feb 18, 2020
1 parent 1d1063f commit 3fb5024
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions e2e/commands/create-nx-workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ describe('create-nx-workspace', () => {
);
await execCommand(
'Add ngrx to the Angular app',
`ng g @nrwl/angular:ngrx state --module=apps/ngapp/src/app/app.module.ts --root`,
`ng g @nrwl/angular:ngrx state --module=apps/ngapp/src/app/app.module.ts --root --no-facade`,
workspaceDir
);

await addReact(workspaceDir);
await execCommand(
`Generate a React app`,
`ng g @nrwl/react:app reactapp --linter=eslint`,
`ng g @nrwl/react:app reactapp --linter=eslint --style=css --no-router`,
workspaceDir
);
await execCommand(`Building angular app`, `ng build ngapp`, workspaceDir);
Expand All @@ -52,6 +52,12 @@ describe('create-nx-workspace', () => {
await execCommand(`Linting angular app`, `ng lint ngapp`, workspaceDir);
await execCommand(`Linting react app`, `ng lint reactapp`, workspaceDir);

expect(
execSync(`npm_config_registry=http://localhost:4873/ && npm audit`, {
cwd: workspaceDir
}).toString()
).toContain(`0 vulnerabilities`);

const webpacks = allVersionsOf(workspaceDir, 'webpack');
if (webpacks.length > 1) {
console.log(`more than one version of webpack: ${webpacks.join(', ')}`);
Expand Down

0 comments on commit 3fb5024

Please sign in to comment.