Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cypress for react v16, v17 and v18 #393

Open
Tracked by #293
100terres opened this issue Aug 21, 2022 · 0 comments
Open
Tracked by #293

Run cypress for react v16, v17 and v18 #393

100terres opened this issue Aug 21, 2022 · 0 comments
Assignees

Comments

@100terres
Copy link
Collaborator

100terres commented Aug 21, 2022

Currently our specs are done on our storybook app. With our current setup it will be diffulct to build storybook with a different react version then the one we have in the our package.json.

We've tried with some aliases, but it was not working since storybook code was expecting react 18.

  const reactMajorVersion = process.env.REACT_MAJOR_VERSION;
  const isOldReactVersion = ['16', '17'].includes(reactMajorVersion);
  const reactModuleSufix = isOldReactVersion ? `-${reactMajorVersion}` : '';

  webpackConfig.resolve.alias = {
    ...config.resolve.alias,
    react: require.resolve(`react${reactModuleSufix}`), // react-16 or react-17
    'react-dom': require.resolve(`react-dom${reactModuleSufix}`), // react-dom-16 or react-dom-17
  };

We'll need to move our cypress tests away from storybook and build a small app where we have full control over the configuration and can easily swap react versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant