chore(testing): fix broken nx-plugin e2e test (#6002)

This commit is contained in:
Miroslav Jonaš 2021-06-14 16:47:06 +02:00 committed by GitHub
parent d4537f75cc
commit a9945e2946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 10 deletions

View File

@ -1,6 +1,7 @@
import { import {
checkFilesExist, checkFilesExist,
expectTestsPass, expectTestsPass,
killPorts,
newProject, newProject,
readJson, readJson,
runCLI, runCLI,
@ -60,9 +61,9 @@ describe('Nx Plugin', () => {
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
if (runCypressTests()) { if (runCypressTests()) {
const results = await runCLIAsync(`e2e ${plugin}-e2e`); const e2eResults = runCLI(`e2e ${plugin}-e2e --no-watch --headless`);
expect(results.stdout).toContain('Compiling TypeScript files'); expect(e2eResults).toContain('Running target "e2e" succeeded');
expectTestsPass(results); expect(await killPorts()).toBeTruthy();
} }
}, 250000); }, 250000);

View File

@ -13,7 +13,7 @@ describe('<%= pluginName %> e2e', () => {
const result = await runNxCommandAsync(`build ${plugin}`); const result = await runNxCommandAsync(`build ${plugin}`);
expect(result.stdout).toContain('Executor ran'); expect(result.stdout).toContain('Executor ran');
}, 10000) }, 30000)
describe('--directory', () => { describe('--directory', () => {
it('should create src in the specified directory', async () => { it('should create src in the specified directory', async () => {
@ -23,7 +23,7 @@ describe('<%= pluginName %> e2e', () => {
`generate <%=npmPackageName%>:<%= pluginName %> ${plugin} --directory subdir` `generate <%=npmPackageName%>:<%= pluginName %> ${plugin} --directory subdir`
); );
expect(() => checkFilesExist(`libs/subdir/${plugin}/src/index.ts`)).not.toThrow(); expect(() => checkFilesExist(`libs/subdir/${plugin}/src/index.ts`)).not.toThrow();
}, 10000); }, 30000);
}); });
describe('--tags', () => { describe('--tags', () => {
@ -35,6 +35,6 @@ describe('<%= pluginName %> e2e', () => {
); );
const nxJson = readJson('nx.json'); const nxJson = readJson('nx.json');
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']); expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
}, 10000); }, 30000);
}); });
}) })

View File

@ -16463,6 +16463,16 @@ markdown-to-jsx@^7.1.0:
resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.2.tgz#19d3da4cd8864045cdd13a0d179147fbd6a088d4" resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.2.tgz#19d3da4cd8864045cdd13a0d179147fbd6a088d4"
integrity sha512-O8DMCl32V34RrD+ZHxcAPc2+kYytuDIoQYjY36RVdsLK7uHjgNVvFec4yv0X6LgB4YEZgSvK5QtFi5YVqEpoMA== integrity sha512-O8DMCl32V34RrD+ZHxcAPc2+kYytuDIoQYjY36RVdsLK7uHjgNVvFec4yv0X6LgB4YEZgSvK5QtFi5YVqEpoMA==
marked@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.1.tgz#5e7ed7009bfa5c95182e4eb696f85e948cefcee3"
integrity sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==
marked@^2.0.1:
version "2.0.7"
resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.7.tgz#bc5b857a09071b48ce82a1f7304913a993d4b7d1"
integrity sha512-BJXxkuIfJchcXOJWTT2DOL+yFWifFv2yGYOUzvXg8Qz610QKw+sHCvTMYwA+qWGhlA2uivBezChZ/pBy1tWdkQ==
marked@^2.0.3: marked@^2.0.3:
version "2.0.6" version "2.0.6"
resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.6.tgz#c3ab1403b9b70f26acd92590fc272eb1718e778c" resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.6.tgz#c3ab1403b9b70f26acd92590fc272eb1718e778c"
@ -17980,10 +17990,10 @@ onigasm@^2.2.5:
dependencies: dependencies:
lru-cache "^5.1.1" lru-cache "^5.1.1"
open@8.0.7: open@8.0.2:
version "8.0.7" version "8.0.2"
resolved "https://registry.yarnpkg.com/open/-/open-8.0.7.tgz#5597eeff14b440f6ff78fb7ced9ede9f69b2122d" resolved "https://registry.yarnpkg.com/open/-/open-8.0.2.tgz#8c3e95cce93ba2fc8d99968ee8bfefecdb50b84f"
integrity sha512-qoyG0kpdaWVoL5MiwTRQWujSdivwBOgfLadVEdpsZNHOK1+kBvmVtLYdgWr8G4cgBpG9zaxezn6jz6PPdQW5xg== integrity sha512-NV5QmWJrTaNBLHABJyrb+nd5dXI5zfea/suWawBhkHzAbVhLLiJdrqMgxMypGK9Eznp2Ltoh7SAVkQ3XAucX7Q==
dependencies: dependencies:
define-lazy-prop "^2.0.0" define-lazy-prop "^2.0.0"
is-docker "^2.1.1" is-docker "^2.1.1"