chore(misc): fix failing test (#15131)
This commit is contained in:
parent
b934edc3dc
commit
576bec2553
@ -10,7 +10,9 @@ describe('Jest root projects', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should test root level app projects', async () => {
|
it('should test root level app projects', async () => {
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --rootProject=true`);
|
runCLI(
|
||||||
|
`generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive`
|
||||||
|
);
|
||||||
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
||||||
expect(rootProjectTestResults.combinedOutput).toContain(
|
expect(rootProjectTestResults.combinedOutput).toContain(
|
||||||
'Test Suites: 1 passed, 1 total'
|
'Test Suites: 1 passed, 1 total'
|
||||||
@ -18,7 +20,7 @@ describe('Jest root projects', () => {
|
|||||||
}, 300_000);
|
}, 300_000);
|
||||||
|
|
||||||
it('should add lib project and tests should still work', async () => {
|
it('should add lib project and tests should still work', async () => {
|
||||||
runCLI(`generate @nrwl/angular:lib ${mylib}`);
|
runCLI(`generate @nrwl/angular:lib ${mylib} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive`
|
`generate @nrwl/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|||||||
@ -66,6 +66,7 @@ describe('Linter', () => {
|
|||||||
? cacheInfo.replace(/\\\\/g, '\\')
|
? cacheInfo.replace(/\\\\/g, '\\')
|
||||||
: cacheInfo;
|
: cacheInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
|
|
||||||
newProject();
|
newProject();
|
||||||
@ -193,12 +194,18 @@ describe('Linter', () => {
|
|||||||
const invalidtaglib = uniq('invalidtaglib');
|
const invalidtaglib = uniq('invalidtaglib');
|
||||||
const validtaglib = uniq('validtaglib');
|
const validtaglib = uniq('validtaglib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --tags=validtag`);
|
runCLI(
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp2}`);
|
`generate @nrwl/angular:app ${myapp} --tags=validtag --no-interactive`
|
||||||
runCLI(`generate @nrwl/angular:lib ${mylib}`);
|
);
|
||||||
runCLI(`generate @nrwl/angular:lib ${lazylib}`);
|
runCLI(`generate @nrwl/angular:app ${myapp2} --no-interactive`);
|
||||||
runCLI(`generate @nrwl/angular:lib ${invalidtaglib} --tags=invalidtag`);
|
runCLI(`generate @nrwl/angular:lib ${mylib} --no-interactive`);
|
||||||
runCLI(`generate @nrwl/angular:lib ${validtaglib} --tags=validtag`);
|
runCLI(`generate @nrwl/angular:lib ${lazylib} --no-interactive`);
|
||||||
|
runCLI(
|
||||||
|
`generate @nrwl/angular:lib ${invalidtaglib} --tags=invalidtag --no-interactive`
|
||||||
|
);
|
||||||
|
runCLI(
|
||||||
|
`generate @nrwl/angular:lib ${validtaglib} --tags=validtag --no-interactive`
|
||||||
|
);
|
||||||
|
|
||||||
const eslint = readJson('.eslintrc.json');
|
const eslint = readJson('.eslintrc.json');
|
||||||
eslint.overrides[0].rules[
|
eslint.overrides[0].rules[
|
||||||
@ -516,7 +523,9 @@ export function tslibC(): string {
|
|||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
|
|
||||||
newProject();
|
newProject();
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --rootProject=true`);
|
runCLI(
|
||||||
|
`generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive`
|
||||||
|
);
|
||||||
|
|
||||||
let rootEslint = readJson('.eslintrc.json');
|
let rootEslint = readJson('.eslintrc.json');
|
||||||
let e2eEslint = readJson('e2e/.eslintrc.json');
|
let e2eEslint = readJson('e2e/.eslintrc.json');
|
||||||
@ -549,7 +558,7 @@ export function tslibC(): string {
|
|||||||
'plugin:@nrwl/nx/javascript',
|
'plugin:@nrwl/nx/javascript',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
runCLI(`generate @nrwl/angular:lib ${mylib}`);
|
runCLI(`generate @nrwl/angular:lib ${mylib} --no-interactive`);
|
||||||
// should add new tslint
|
// should add new tslint
|
||||||
expect(() => checkFilesExist(`.eslintrc.base.json`)).not.toThrow();
|
expect(() => checkFilesExist(`.eslintrc.base.json`)).not.toThrow();
|
||||||
const appEslint = readJson(`.eslintrc.json`);
|
const appEslint = readJson(`.eslintrc.json`);
|
||||||
@ -731,6 +740,7 @@ function updateGeneratedRuleImplementation(
|
|||||||
|
|
||||||
return ts.visitEachChild(node, visit, context);
|
return ts.visitEachChild(node, visit, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add lib import as a first line of the rule file.
|
* Add lib import as a first line of the rule file.
|
||||||
* Needed for the access of getMessageId in the context report above.
|
* Needed for the access of getMessageId in the context report above.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user