Skip to content

Commit

Permalink
test: test for react-native-web-vite exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Jan 5, 2025
1 parent b0aac2a commit 45e96d3
Showing 1 changed file with 48 additions and 0 deletions.
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();
});
});

0 comments on commit 45e96d3

Please sign in to comment.