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';
|
const linter = currentCLIName === 'angular' ? 'tslint' : 'eslint';
|
||||||
|
|
||||||
describe('Node Applications', () => {
|
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();
|
ensureProject();
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
|
|
||||||
|
|||||||
49
e2e/utils.ts
49
e2e/utils.ts
@ -272,7 +272,11 @@ export function copyMissingPackages(): void {
|
|||||||
'speed-measure-webpack-plugin',
|
'speed-measure-webpack-plugin',
|
||||||
'webpack-merge',
|
'webpack-merge',
|
||||||
'istanbul-instrumenter-loader',
|
'istanbul-instrumenter-loader',
|
||||||
'semver'
|
'semver',
|
||||||
|
|
||||||
|
'mime',
|
||||||
|
'less',
|
||||||
|
'send'
|
||||||
];
|
];
|
||||||
modulesToCopy.forEach(m => copyNodeModule(m));
|
modulesToCopy.forEach(m => copyNodeModule(m));
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -298,11 +302,8 @@ export function copyMissingPackages(): void {
|
|||||||
)}`
|
)}`
|
||||||
);
|
);
|
||||||
execSync(`rm -rf ${tmpProjPath('node_modules/cypress/node_modules/@types')}`);
|
execSync(`rm -rf ${tmpProjPath('node_modules/cypress/node_modules/@types')}`);
|
||||||
execSync(
|
execSync(`rm -rf node_modules/karma/node_modules/mime`);
|
||||||
`cp -a node_modules/mime ${tmpProjPath(
|
execSync(`rm -rf node_modules/ng-packagr/node_modules/mime`);
|
||||||
'node_modules/karma/node_modules/mime'
|
|
||||||
)}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyNodeModule(name: string) {
|
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(
|
export function runCLI(
|
||||||
command?: string,
|
command?: string,
|
||||||
opts = {
|
opts = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user