From ca12ec652d69b65f573916436aeaa9cec26815da Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 9 Jul 2018 21:01:45 -0300 Subject: [PATCH] Throw when wrong args are provided --- src/core/client/stream/test/loadMore.spec.tsx | 3 ++- src/core/client/stream/test/renderReplies.spec.tsx | 1 + src/core/client/stream/test/renderStream.spec.tsx | 1 + src/core/client/stream/test/showAllReplies.spec.tsx | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/client/stream/test/loadMore.spec.tsx b/src/core/client/stream/test/loadMore.spec.tsx index 0971e899e..fdc901f4a 100644 --- a/src/core/client/stream/test/loadMore.spec.tsx +++ b/src/core/client/stream/test/loadMore.spec.tsx @@ -10,7 +10,7 @@ import AppQuery from "talk-stream/queries/AppQuery"; import createEnvironment from "./createEnvironment"; import { assets, comments } from "./fixtures"; -const connectionStub = sinon.stub(); +const connectionStub = sinon.stub().throws(); connectionStub.withArgs({ first: 5, orderBy: "CREATED_AT_DESC" }).returns({ edges: [ { @@ -55,6 +55,7 @@ const resolvers = { Query: { asset: sinon .stub() + .throws() .withArgs(undefined, { id: assetStub.id }) .returns(assetStub), }, diff --git a/src/core/client/stream/test/renderReplies.spec.tsx b/src/core/client/stream/test/renderReplies.spec.tsx index b1d6b43c2..9c535520f 100644 --- a/src/core/client/stream/test/renderReplies.spec.tsx +++ b/src/core/client/stream/test/renderReplies.spec.tsx @@ -14,6 +14,7 @@ const resolvers = { Query: { asset: sinon .stub() + .throws() .withArgs(undefined, { id: assetWithReplies.id }) .returns(assetWithReplies), }, diff --git a/src/core/client/stream/test/renderStream.spec.tsx b/src/core/client/stream/test/renderStream.spec.tsx index c5027bd7f..998058cce 100644 --- a/src/core/client/stream/test/renderStream.spec.tsx +++ b/src/core/client/stream/test/renderStream.spec.tsx @@ -14,6 +14,7 @@ const resolvers = { Query: { asset: sinon .stub() + .throws() .withArgs(undefined, { id: assets[0].id }) .returns(assets[0]), }, diff --git a/src/core/client/stream/test/showAllReplies.spec.tsx b/src/core/client/stream/test/showAllReplies.spec.tsx index 665679b76..a3802c49e 100644 --- a/src/core/client/stream/test/showAllReplies.spec.tsx +++ b/src/core/client/stream/test/showAllReplies.spec.tsx @@ -10,7 +10,7 @@ import AppQuery from "talk-stream/queries/AppQuery"; import createEnvironment from "./createEnvironment"; import { assets, comments } from "./fixtures"; -const connectionStub = sinon.stub(); +const connectionStub = sinon.stub().throws(); connectionStub.withArgs({ first: 5, orderBy: "CREATED_AT_ASC" }).returns({ edges: [ { @@ -66,10 +66,12 @@ const resolvers = { Query: { comment: sinon .stub() + .throws() .withArgs(undefined, { id: commentStub.id }) .returns(commentStub), asset: sinon .stub() + .throws() .withArgs(undefined, { id: assetStub.id }) .returns(assetStub), },