1+ import { InMemoryCache } from 'apollo-cache-inmemory' ;
2+ import { ApolloClient } from 'apollo-client' ;
13import { expect } from 'chai' ;
4+ import { parse } from 'graphql' ;
5+ import sinon from 'sinon' ;
26import Client from 'slicknode-client' ;
37import SlicknodeLink from '../index' ;
4- import sinon from 'sinon' ;
5- import { ApolloClient } from 'apollo-client' ;
6- import { InMemoryCache } from 'apollo-cache-inmemory' ;
7- import { parse } from 'graphql' ;
88
99describe ( 'SlicknodeLink' , ( ) => {
1010 it ( 'fails for missing configuration options' , ( ) => {
@@ -38,14 +38,14 @@ describe('SlicknodeLink', () => {
3838 value : 'test' ,
3939 } ,
4040 } ;
41- sinon . stub ( client , " fetch" ) . resolves ( payload ) ;
41+ sinon . stub ( client , ' fetch' ) . resolves ( payload ) ;
4242 const apolloClient = new ApolloClient ( {
4343 link,
44- cache : new InMemoryCache ( )
44+ cache : new InMemoryCache ( ) ,
4545 } ) ;
4646
4747 const result = await apolloClient . query ( {
48- query : parse ( '{value}' )
48+ query : parse ( '{value}' ) ,
4949 } ) ;
5050
5151 expect ( result . data ) . to . deep . equal ( payload . data ) ;
@@ -60,15 +60,15 @@ describe('SlicknodeLink', () => {
6060 } ) ;
6161
6262 const errorMessage = 'Error fetching data' ;
63- sinon . stub ( client , " fetch" ) . throws ( errorMessage ) ;
63+ sinon . stub ( client , ' fetch' ) . throws ( errorMessage ) ;
6464 const apolloClient = new ApolloClient ( {
6565 link,
66- cache : new InMemoryCache ( )
66+ cache : new InMemoryCache ( ) ,
6767 } ) ;
6868
6969 try {
7070 const result = await apolloClient . query ( {
71- query : parse ( '{value}' )
71+ query : parse ( '{value}' ) ,
7272 } ) ;
7373 } catch ( e ) {
7474 expect ( e . networkError . name ) . to . deep . equal ( errorMessage ) ;
0 commit comments