File tree Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Original file line number Diff line number Diff line change 21
21
"ts-jest" : " ^25.2.0"
22
22
},
23
23
"scripts" : {
24
- "test" : " jest" ,
24
+ "test" : " tsc && jest" ,
25
25
"prepublishOnly" : " tsc"
26
26
},
27
27
"dependencies" : {
Original file line number Diff line number Diff line change 1
- import graphqlRubyClient from "../index"
1
+ import { sync } from "../index"
2
+ import childProcess from "child_process"
2
3
3
- it ( "exports the sync function" , ( ) => {
4
- expect ( graphqlRubyClient . sync ) . toBeInstanceOf ( Function )
4
+ describe ( "root module" , ( ) => {
5
+ it ( "exports the sync function" , ( ) => {
6
+ expect ( sync ) . toBeInstanceOf ( Function )
7
+ } )
8
+
9
+ it ( "exports things at root level" , ( ) => {
10
+ // Make sure that the compiled JavaScript
11
+ // has all the expected exports.
12
+ var testScript = "var client = require('./dist/index'); console.log(JSON.stringify({ keys: Object.keys(client).sort() }))"
13
+ var output = childProcess . execSync ( "node -e \"" + testScript + "\"" )
14
+ var outputData = JSON . parse ( output . toString ( ) )
15
+ var expectedKeys = [
16
+ "AblyLink" ,
17
+ "ActionCableLink" ,
18
+ "PusherLink" ,
19
+ "addGraphQLSubscriptions" ,
20
+ "createRelaySubscriptionHandler" ,
21
+ "generateClient" ,
22
+ "sync"
23
+ ]
24
+ expect ( outputData . keys ) . toEqual ( expectedKeys )
25
+ } )
5
26
} )
Original file line number Diff line number Diff line change 1
1
import sync from "./sync"
2
2
import { generateClient } from "./sync/generateClient"
3
- export default {
3
+ import ActionCableLink from "./subscriptions/ActionCableLink"
4
+ import PusherLink from "./subscriptions/PusherLink"
5
+ import AblyLink from "./subscriptions/AblyLink"
6
+ import addGraphQLSubscriptions from "./subscriptions/addGraphQLSubscriptions"
7
+ import createHandler from "./subscriptions/createHandler"
8
+
9
+ export {
4
10
sync ,
5
- generateClient
11
+ generateClient ,
12
+ ActionCableLink ,
13
+ PusherLink ,
14
+ AblyLink ,
15
+ addGraphQLSubscriptions ,
16
+ createHandler as createRelaySubscriptionHandler ,
6
17
}
You can’t perform that action at this time.
0 commit comments