nx/e2e/schematics/upgrade-module.test.ts
2018-08-02 13:39:19 -04:00

42 lines
974 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 --no-watch');
},
1000000
);
});