build(nx): fix e2e tests
This commit is contained in:
parent
d67711c432
commit
313de9ca4f
@ -35,7 +35,7 @@ forEachCli(currentCLIName => {
|
||||
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
||||
|
||||
describe('Node Applications', () => {
|
||||
fit('should be able to generate an express application', async done => {
|
||||
it('should be able to generate an express application', async done => {
|
||||
ensureProject();
|
||||
const nodeapp = uniq('nodeapp');
|
||||
|
||||
|
||||
49
e2e/utils.ts
49
e2e/utils.ts
@ -272,7 +272,11 @@ export function copyMissingPackages(): void {
|
||||
'speed-measure-webpack-plugin',
|
||||
'webpack-merge',
|
||||
'istanbul-instrumenter-loader',
|
||||
'semver'
|
||||
'semver',
|
||||
|
||||
'mime',
|
||||
'less',
|
||||
'send'
|
||||
];
|
||||
modulesToCopy.forEach(m => copyNodeModule(m));
|
||||
updateFile(
|
||||
@ -298,11 +302,8 @@ export function copyMissingPackages(): void {
|
||||
)}`
|
||||
);
|
||||
execSync(`rm -rf ${tmpProjPath('node_modules/cypress/node_modules/@types')}`);
|
||||
execSync(
|
||||
`cp -a node_modules/mime ${tmpProjPath(
|
||||
'node_modules/karma/node_modules/mime'
|
||||
)}`
|
||||
);
|
||||
execSync(`rm -rf node_modules/karma/node_modules/mime`);
|
||||
execSync(`rm -rf node_modules/ng-packagr/node_modules/mime`);
|
||||
}
|
||||
|
||||
function copyNodeModule(name: string) {
|
||||
@ -369,42 +370,6 @@ export function runNgAdd(
|
||||
}
|
||||
}
|
||||
|
||||
export function runCLIFromSubfolder(
|
||||
command?: string,
|
||||
subFolder?: string,
|
||||
opts = {
|
||||
silenceError: false
|
||||
}
|
||||
): string {
|
||||
const backToRoot = subFolder
|
||||
? subFolder
|
||||
.split('/')
|
||||
.map(_ => '..')
|
||||
.join('/')
|
||||
: '.';
|
||||
|
||||
try {
|
||||
return execSync(
|
||||
`node ${backToRoot}/node_modules/@nrwl/cli/bin/nx.js ${command}`,
|
||||
{
|
||||
cwd: tmpProjPath(subFolder)
|
||||
}
|
||||
)
|
||||
.toString()
|
||||
.replace(
|
||||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
||||
''
|
||||
);
|
||||
} catch (e) {
|
||||
if (opts.silenceError) {
|
||||
return e.stdout.toString();
|
||||
} else {
|
||||
console.log(e.stdout.toString(), e.stderr.toString());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function runCLI(
|
||||
command?: string,
|
||||
opts = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user