mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 07:21:16 +08:00
22 lines
598 B
TypeScript
22 lines
598 B
TypeScript
import { filterPresetsConfig } from './config';
|
|
|
|
describe('filterPresetsConfig', () => {
|
|
it('string config', () => {
|
|
expect(
|
|
filterPresetsConfig(['@storybook/preset-scss', '@storybook/preset-typescript'])
|
|
).toEqual(['@storybook/preset-scss']);
|
|
});
|
|
|
|
it('windows paths', () => {
|
|
expect(filterPresetsConfig(['a', '@storybook\\preset-typescript'])).toEqual(['a']);
|
|
});
|
|
|
|
it('object config', () => {
|
|
const tsConfig = {
|
|
name: '@storybook/preset-typescript',
|
|
options: { foo: 1 },
|
|
};
|
|
expect(filterPresetsConfig([tsConfig, 'a'])).toEqual(['a']);
|
|
});
|
|
});
|