remove semverRange from the env var runs
MODIFY
bin-src/lib/getStorybookInfo.test.ts
bin-src/lib/getStorybookInfo.test.ts
@@ -104,24 +104,6 @@ describe('getStorybookInfo', () => {
);
});
- it('returns viewLayer and version from with env with caret in version', async () => {
- const ctx = getContext({
- env: { CHROMATIC_STORYBOOK_VERSION: '@storybook/react@^3.2.1' },
- });
- await expect(getStorybookInfo(ctx)).resolves.toEqual(
- expect.objectContaining({ viewLayer: 'react', version: '>=3.2.1 <4.0.0-0' })
- );
- });
-
- it('returns viewLayer and version from with env with tilda in version', async () => {
- const ctx = getContext({
- env: { CHROMATIC_STORYBOOK_VERSION: '@storybook/react@~3.2.1' },
- });
- await expect(getStorybookInfo(ctx)).resolves.toEqual(
- expect.objectContaining({ viewLayer: 'react', version: '>=3.2.1 <3.3.0-0' })
- );
- });
-
it('supports unscoped package name', async () => {
const ctx = getContext({ env: { CHROMATIC_STORYBOOK_VERSION: 'react@3.2.1' } });
await expect(getStorybookInfo(ctx)).resolves.toEqual(

MODIFY
bin-src/lib/getStorybookInfo.ts
bin-src/lib/getStorybookInfo.ts
@@ -37,7 +37,7 @@ const findViewlayer = async ({ env, log, options, packageJson }) => {
// Allow setting Storybook version via CHROMATIC_STORYBOOK_VERSION='@storybook/react@4.0-alpha.8' for unusual cases
if (env.CHROMATIC_STORYBOOK_VERSION) {
const [, p, v] = env.CHROMATIC_STORYBOOK_VERSION.match(/(.+)@(.+)$/) || [];
- const version = semver.valid(v) || semver.validRange(v); // ensures we get a specific version, not a range
+ const version = semver.valid(v); // ensures we get a specific version, not a range
if (!p || !version) {
throw new Error(

remove semverRange from the env var runs