mirror of
https://github.com/wassname/talk.git
synced 2026-07-11 19:51:22 +08:00
Throw when wrong args are provided
This commit is contained in:
@@ -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),
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ const resolvers = {
|
||||
Query: {
|
||||
asset: sinon
|
||||
.stub()
|
||||
.throws()
|
||||
.withArgs(undefined, { id: assetWithReplies.id })
|
||||
.returns(assetWithReplies),
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ const resolvers = {
|
||||
Query: {
|
||||
asset: sinon
|
||||
.stub()
|
||||
.throws()
|
||||
.withArgs(undefined, { id: assets[0].id })
|
||||
.returns(assets[0]),
|
||||
},
|
||||
|
||||
@@ -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),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user