From 87d6f5e91b5de1586832772f7bff907f62b4932f Mon Sep 17 00:00:00 2001 From: ksakiyama Date: Sun, 9 Sep 2018 09:53:11 +0900 Subject: [PATCH 1/2] fix jest error(SecurityError: localStorage is not available for opaque origins) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b8b1d27..facce6b 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "setupTestFrameworkScriptFile": "/test-setup.js", "snapshotSerializers": [ "enzyme-to-json/serializer" - ] + ], + "testEnvironment": "node" }, "nodemonConfig": { "ignore": [ From 5f98d4e5b82b96a0358c5b34588ba4a6dc211ee8 Mon Sep 17 00:00:00 2001 From: ksakiyama Date: Sun, 9 Sep 2018 09:55:14 +0900 Subject: [PATCH 2/2] input empty instead of this.props.serverState.apollo.data --- src/helpers/withData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/withData.js b/src/helpers/withData.js index 38706de..e92f690 100644 --- a/src/helpers/withData.js +++ b/src/helpers/withData.js @@ -83,7 +83,7 @@ export default (ComposedComponent) => { // render within `getInitialProps()` above (since the entire prop tree // will be initialized there), meaning the below will only ever be // executed on the client. - this.apollo = initApollo(this.props.serverState.apollo.data, { + this.apollo = initApollo({}, { getToken: () => parseCookies(), // ['connect.sid'], }); }