mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
refactor(e2e): use base CRA tests config for Yarn 2 instead of a custom one
This commit is contained in:
parent
7e95114d79
commit
6515930833
@ -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
|
||||
|
@ -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',
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user