diff --git a/e2e/bazel/app.test.ts b/e2e/bazel/app.test.ts index 08ef706957..7457b47006 100644 --- a/e2e/bazel/app.test.ts +++ b/e2e/bazel/app.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, copyMissingPackages, ngNewBazel, readFile, runCLI, runSchematic} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, ngNewBazel, readFile, runCLI, runSchematic} from '../utils'; describe('application', () => { beforeEach(cleanup); @@ -8,7 +8,7 @@ describe('application', () => { ngNewBazel('--collection=@nrwl/bazel --skip-install'); runSchematic('@nrwl/bazel:app --name=myApp'); - checkFilesExists( + checkFilesExist( `tsconfig.json`, `WORKSPACE`, `BUILD.bazel`, `apps/my-app/BUILD.bazel`, `apps/my-app/src/index.html`, `apps/my-app/src/app/app.module.ts`, `apps/my-app/src/app/app.component.ts`); diff --git a/e2e/bazel/lib.test.ts b/e2e/bazel/lib.test.ts index ea1ad0103e..0e548d58c4 100644 --- a/e2e/bazel/lib.test.ts +++ b/e2e/bazel/lib.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, copyMissingPackages, ngNewBazel, readFile, runCLI, runSchematic} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, ngNewBazel, readFile, runCLI, runSchematic} from '../utils'; describe('library', () => { beforeEach(cleanup); @@ -8,7 +8,7 @@ describe('library', () => { ngNewBazel('--collection=@nrwl/bazel --skip-install'); runSchematic('@nrwl/bazel:lib --name=myLib'); - checkFilesExists( + checkFilesExist( 'tsconfig.json', 'WORKSPACE', 'BUILD.bazel', 'libs/my-lib/BUILD.bazel', 'libs/my-lib/index.ts', 'libs/my-lib/src/my-lib.ts'); diff --git a/e2e/bazel/nglib.test.ts b/e2e/bazel/nglib.test.ts index 7fe11f012a..68b17f5585 100644 --- a/e2e/bazel/nglib.test.ts +++ b/e2e/bazel/nglib.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, copyMissingPackages, ngNew, ngNewBazel, readFile, runCLI, runCommand, runSchematic, updateFile} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, ngNew, ngNewBazel, readFile, runCLI, runCommand, runSchematic, updateFile} from '../utils'; describe('angular library', () => { beforeEach(cleanup); @@ -8,7 +8,7 @@ describe('angular library', () => { ngNewBazel('--collection=@nrwl/bazel --skip-install'); runSchematic('@nrwl/bazel:nglib --name=myLib'); - checkFilesExists( + checkFilesExist( 'tsconfig.json', 'WORKSPACE', 'BUILD.bazel', 'libs/my-lib/BUILD.bazel', 'libs/my-lib/index.ts', 'libs/my-lib/src/my-lib.module.ts'); diff --git a/e2e/bazel/workspace.test.ts b/e2e/bazel/workspace.test.ts index a36fde429f..8be3d82318 100644 --- a/e2e/bazel/workspace.test.ts +++ b/e2e/bazel/workspace.test.ts @@ -1,10 +1,10 @@ -import {checkFilesExists, cleanup, copyMissingPackages, ngNew, ngNewBazel, readFile, runCLI, runCommand, runSchematic, updateFile} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, ngNew, ngNewBazel, readFile, runCLI, runCommand, runSchematic, updateFile} from '../utils'; describe('workspace', () => { beforeEach(cleanup); it('creates a new workspace for developing angular applications', () => { ngNewBazel('--collection=@nrwl/bazel --skip-install'); - checkFilesExists(`tsconfig.json`, `WORKSPACE`, `BUILD.bazel`); + checkFilesExist(`tsconfig.json`, `WORKSPACE`, `BUILD.bazel`); }); }); diff --git a/e2e/schematics/convert-to-workspace.test.ts b/e2e/schematics/convert-to-workspace.test.ts index 405588cf1d..2e1585c49b 100644 --- a/e2e/schematics/convert-to-workspace.test.ts +++ b/e2e/schematics/convert-to-workspace.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, ngNew, readFile, runCLI, runSchematic, updateFile} from '../utils'; +import {checkFilesExist, cleanup, ngNew, readFile, runCLI, runSchematic, updateFile} from '../utils'; describe('Nrwl Convert to Nx Workspace', () => { beforeEach(cleanup); @@ -27,7 +27,7 @@ describe('Nrwl Convert to Nx Workspace', () => { runSchematic('@nrwl/schematics:convert-to-workspace'); // check that files have been moved! - checkFilesExists('apps/proj/src/main.ts', 'apps/proj/src/app/app.module.ts'); + checkFilesExist('apps/proj/src/main.ts', 'apps/proj/src/app/app.module.ts'); // check that package.json got merged const updatedPackageJson = JSON.parse(readFile('package.json')); diff --git a/e2e/schematics/ngrx.test.ts b/e2e/schematics/ngrx.test.ts index e6a596141a..f5ccd1343c 100644 --- a/e2e/schematics/ngrx.test.ts +++ b/e2e/schematics/ngrx.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, copyMissingPackages, ngNew, readFile, runCLI} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, ngNew, readFile, runCLI} from '../utils'; describe('ngrx', () => { beforeEach(cleanup); @@ -8,7 +8,7 @@ describe('ngrx', () => { ngNew('--skip-install'); runCLI('generate ngrx app --module=src/app/app.module.ts --root --collection=@nrwl/schematics'); - checkFilesExists( + checkFilesExist( `src/app/+state/app.actions.ts`, `src/app/+state/app.effects.ts`, `src/app/+state/app.effects.spec.ts`, `src/app/+state/app.init.ts`, `src/app/+state/app.interfaces.ts`, `src/app/+state/app.reducer.ts`, `src/app/+state/app.reducer.spec.ts`); @@ -45,7 +45,7 @@ describe('ngrx', () => { ngNew('--skip-install'); runCLI('generate ngrx app --module=src/app/app.module.ts --collection=@nrwl/schematics'); - checkFilesExists( + checkFilesExist( `src/app/+state/app.actions.ts`, `src/app/+state/app.effects.ts`, `src/app/+state/app.effects.spec.ts`, `src/app/+state/app.init.ts`, `src/app/+state/app.interfaces.ts`, `src/app/+state/app.reducer.ts`, `src/app/+state/app.reducer.spec.ts`); @@ -60,7 +60,7 @@ describe('ngrx', () => { ngNew('--skip-install'); runCLI('generate ngrx app --module=src/app/app.module.ts --onlyAddFiles --collection=@nrwl/schematics'); - checkFilesExists( + checkFilesExist( `src/app/+state/app.actions.ts`, `src/app/+state/app.effects.ts`, `src/app/+state/app.effects.spec.ts`, `src/app/+state/app.init.ts`, `src/app/+state/app.interfaces.ts`, `src/app/+state/app.reducer.ts`, `src/app/+state/app.reducer.spec.ts`); diff --git a/e2e/schematics/workspace.test.ts b/e2e/schematics/workspace.test.ts index 1b18864329..ebfabfc2e3 100644 --- a/e2e/schematics/workspace.test.ts +++ b/e2e/schematics/workspace.test.ts @@ -1,4 +1,4 @@ -import {checkFilesExists, cleanup, copyMissingPackages, newApp, newLib, ngNew, readFile, runCLI, updateFile} from '../utils'; +import {checkFilesExist, cleanup, copyMissingPackages, newApp, newLib, ngNew, readFile, runCLI, updateFile} from '../utils'; describe('Nrwl Workspace', () => { beforeEach(cleanup); @@ -12,7 +12,7 @@ describe('Nrwl Workspace', () => { const packageJson = JSON.parse(readFile('package.json')); expect(packageJson.devDependencies['@nrwl/schematics']).toBeDefined(); expect(packageJson.dependencies['@nrwl/nx']).toBeDefined(); - checkFilesExists('test.js', 'tsconfig.app.json', 'tsconfig.spec.json', 'tsconfig.e2e.json', 'apps', 'libs'); + checkFilesExist('test.js', 'tsconfig.app.json', 'tsconfig.spec.json', 'tsconfig.e2e.json', 'apps', 'libs'); }); describe('app', () => { @@ -23,7 +23,7 @@ describe('Nrwl Workspace', () => { const angularCliJson = JSON.parse(readFile('.angular-cli.json')); expect(angularCliJson.apps[0].name).toEqual('myapp'); - checkFilesExists( + checkFilesExist( 'apps/myapp/src/main.ts', 'apps/myapp/src/app/app.module.ts', 'apps/myapp/src/app/app.component.ts', 'apps/myapp/e2e/app.po.ts'); }); @@ -33,7 +33,7 @@ describe('Nrwl Workspace', () => { copyMissingPackages(); newApp('myapp'); runCLI('build --aot'); - checkFilesExists('dist/apps/myapp/main.bundle.js'); + checkFilesExist('dist/apps/myapp/main.bundle.js'); expect(runCLI('test --single-run')).toContain('Executed 1 of 1 SUCCESS'); }); }); @@ -46,7 +46,7 @@ describe('Nrwl Workspace', () => { const angularCliJson = JSON.parse(readFile('.angular-cli.json')); expect(angularCliJson.apps[0].name).toEqual('mylib'); - checkFilesExists('libs/mylib/src/mylib.ts', 'libs/mylib/src/mylib.spec.ts', 'libs/mylib/index.ts'); + checkFilesExist('libs/mylib/src/mylib.ts', 'libs/mylib/src/mylib.spec.ts', 'libs/mylib/index.ts'); }); it('should test a lib', () => { @@ -64,7 +64,7 @@ describe('Nrwl Workspace', () => { ngNew('--collection=@nrwl/schematics --skip-install'); newLib('mylib --ngmodule'); - checkFilesExists('libs/mylib/src/mylib.module.ts', 'libs/mylib/src/mylib.module.spec.ts', 'libs/mylib/index.ts'); + checkFilesExist('libs/mylib/src/mylib.module.ts', 'libs/mylib/src/mylib.module.spec.ts', 'libs/mylib/index.ts'); }); it('should test an ng lib', () => { diff --git a/e2e/utils.ts b/e2e/utils.ts index 63987c664b..041fa575f7 100644 --- a/e2e/utils.ts +++ b/e2e/utils.ts @@ -46,7 +46,7 @@ export function updateFile(f: string, content: string): void { writeFileSync(path.join(getCwd(), 'tmp', 'proj', f), content); } -export function checkFilesExists(...expectedFiles: string[]) { +export function checkFilesExist(...expectedFiles: string[]) { expectedFiles.forEach(f => { const ff = f.startsWith('/') ? f : path.join(getCwd(), 'tmp', projectName, f); if (!exists(ff)) {