Merge pull request #3717 from storybooks/storyshots-remove-deprecations

[Storyshots] Remove deprecated props from storyshots
This commit is contained in:
Filipp Riabchun 2018-06-08 08:28:01 +02:00 committed by GitHub
commit ed430d06e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,17 +45,15 @@ export default function testStorySnapshots(options = {}) {
throw new Error('storyshots found 0 stories');
}
// NOTE: keep `suit` typo for backwards compatibility
const suite = options.suite || options.suit || 'Storyshots';
// NOTE: Added not to break existing storyshots configs (can be removed in a future major release)
const storyNameRegex = options.storyNameRegex || options.storyRegex;
const {
suite = 'Storyshots',
storyNameRegex,
storyKindRegex,
renderer,
serializer,
test: testMethod = snapshotWithOptions({ renderer, serializer }),
} = options;
const snapshotOptions = {
renderer: options.renderer,
serializer: options.serializer,
};
const testMethod = options.test || snapshotWithOptions(snapshotOptions);
const integrityOptions = getIntegrityOptions(options);
methods.forEach(method => {
@ -68,7 +66,7 @@ export default function testStorySnapshots(options = {}) {
for (const group of stories) {
const { fileName, kind } = group;
if (options.storyKindRegex && !kind.match(options.storyKindRegex)) {
if (storyKindRegex && !kind.match(storyKindRegex)) {
// eslint-disable-next-line
continue;
}