refactor(e2e): use base CRA tests config for Yarn 2 instead of a custom one

This commit is contained in:
Gaëtan Maisse 2020-06-29 21:24:33 +02:00
parent 7e95114d79
commit 6515930833
No known key found for this signature in database
GPG Key ID: D934C0EF3714A8A8
3 changed files with 6 additions and 8 deletions

View File

@ -159,7 +159,7 @@ jobs:
command: yarn info @storybook/core
- run:
name: run e2e tests
command: yarn test:e2e-framework --use-yarn-2 yarn_2_cra
command: yarn test:e2e-framework --use-yarn-2 cra
- store_artifacts:
path: /tmp/storybook/cypress
destination: cypress

View File

@ -177,12 +177,6 @@ export const webpack_react: Parameters = {
generator: fromDeps('react', 'react-dom', 'webpack'),
};
export const yarn_2_cra: Parameters = {
name: 'yarn_2_cra',
version: 'latest',
generator: `yarn dlx create-react-app@{{version}} {{name}}-v{{version}}`,
};
export const react_in_yarn_workspace: Parameters = {
name: 'react_in_yarn_workspace',
version: 'latest',

View File

@ -96,7 +96,11 @@ const configureYarn2 = async ({ cwd }: Options) => {
};
const generate = async ({ cwd, name, version, generator }: Options) => {
const command = generator.replace(/{{name}}/g, name).replace(/{{version}}/g, version);
let command = generator.replace(/{{name}}/g, name).replace(/{{version}}/g, version);
if (useYarn2) {
command = command.replace(/npx/g, `yarn dlx`);
}
logger.info(`🏗Bootstrapping ${name} project`);
logger.debug(command);