-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30190 from storybookjs/danny/rnw-doesnt-require-v…
…ite-conf Automigrations: Skip vite config file migration for react native web
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
code/lib/cli-storybook/src/automigrate/fixes/vite-config-file.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import type { StorybookConfig } from 'storybook/internal/types'; | ||
|
||
import { viteConfigFile } from './vite-config-file'; | ||
|
||
const check = async ({ | ||
packageManager, | ||
main: mainConfig, | ||
storybookVersion = '8.0.0', | ||
}: { | ||
packageManager: any; | ||
main: Partial<StorybookConfig> & Record<string, unknown>; | ||
storybookVersion?: string; | ||
}) => { | ||
return viteConfigFile.check({ | ||
packageManager, | ||
configDir: '', | ||
mainConfig: mainConfig as any, | ||
storybookVersion, | ||
}); | ||
}; | ||
|
||
describe('no-ops', () => { | ||
it('skips when react-native-web-vite', async () => { | ||
await expect( | ||
check({ | ||
packageManager: {}, | ||
main: { | ||
framework: '@storybook/react-native-web-vite', | ||
}, | ||
}) | ||
).resolves.toBeFalsy(); | ||
}); | ||
}); | ||
|
||
describe('continue', () => { | ||
it('executes for vite framework', async () => { | ||
await expect( | ||
check({ | ||
packageManager: {}, | ||
main: { | ||
framework: '@storybook/react-vite', | ||
}, | ||
}) | ||
).resolves.toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters