From 991e8172529662b023a19632c499ef021231c9d7 Mon Sep 17 00:00:00 2001 From: igor-dv Date: Tue, 5 Jun 2018 22:34:53 +0300 Subject: [PATCH] Remove "deprecations" from storyshots --- addons/storyshots/src/index.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/addons/storyshots/src/index.js b/addons/storyshots/src/index.js index 79eb669e048..2bd5af7e612 100644 --- a/addons/storyshots/src/index.js +++ b/addons/storyshots/src/index.js @@ -45,17 +45,16 @@ 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, + } = options; - const snapshotOptions = { - renderer: options.renderer, - serializer: options.serializer, - }; - - const testMethod = options.test || snapshotWithOptions(snapshotOptions); + const testMethod = test || snapshotWithOptions({ renderer, serializer }); const integrityOptions = getIntegrityOptions(options); methods.forEach(method => { @@ -68,7 +67,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; }