nx/e2e/schematics/upgrade-module.test.ts
Thomas Burleson aa1b7766c5 fix(ngrx): fix lint issues in schematic templates
The ngrx schematic templates have some minor lint errors that manfiest in new ngrx generated code.

*  In the ngrx e2e tests, add check for tsLint errors in the generated code
*  Fix lint issues for the upgrade-module and associated tests.
2018-07-29 11:30:04 -04:00

42 lines
976 B
TypeScript

import { newApp, newProject, runCLI, updateFile } from '../utils';
describe('Upgrade', () => {
it(
'should generate an UpgradeModule setup',
() => {
newProject();
newApp('myapp');
updateFile(
'apps/myapp/src/legacy.js',
`
const angular = window.angular.module('legacy', []);
angular.component('proj-root-legacy', {
template: 'Expected Value'
});
`
);
updateFile(
'apps/myapp/src/app/app.component.html',
`
EXPECTED [<proj-root-legacy></proj-root-legacy>]
`
);
updateFile('apps/myapp/src/app/app.component.spec.ts', ``);
runCLI(
'generate upgrade-module legacy --angularJsImport=./legacy ' +
'--angularJsCmpSelector=proj-root-legacy --project=myapp'
);
expect(runCLI('lint', { silenceError: true })).not.toContain('ERROR');
runCLI('build');
runCLI('test --single-run');
},
1000000
);
});