From 6117d21c06d68ea5d98a26e4b7f9c64f1581d5c3 Mon Sep 17 00:00:00 2001 From: igor-dv Date: Wed, 5 Dec 2018 16:47:54 +0200 Subject: [PATCH] Move 'core-js/modules/es6.promise' into storyshots --- .../storyshots-core/src/frameworks/angular/loader.js | 3 +++ examples/angular-cli/angularshots.test.js | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/storyshots/storyshots-core/src/frameworks/angular/loader.js b/addons/storyshots/storyshots-core/src/frameworks/angular/loader.js index 981da4f36a76..9019699ac72e 100644 --- a/addons/storyshots/storyshots-core/src/frameworks/angular/loader.js +++ b/addons/storyshots/storyshots-core/src/frameworks/angular/loader.js @@ -2,6 +2,9 @@ import hasDependency from '../hasDependency'; import configure from '../configure'; function setupAngularJestPreset() { + // Needed to prevent "Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten." + require.requireActual('core-js/modules/es6.promise'); + // Angular + Jest + Storyshots = Crazy Shit: // We need to require 'jest-preset-angular/setupJest' before any storybook code // is running inside jest - one of the things that `jest-preset-angular/setupJest` does is diff --git a/examples/angular-cli/angularshots.test.js b/examples/angular-cli/angularshots.test.js index e156d5afbd16..41dfc8a015a2 100644 --- a/examples/angular-cli/angularshots.test.js +++ b/examples/angular-cli/angularshots.test.js @@ -1,5 +1,3 @@ -// Needed to prevent "Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten." -import 'core-js/modules/es6.promise'; import path from 'path'; import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots';