Skip to content

Commit

Permalink
Merge pull request #6 from armand1m/master
Browse files Browse the repository at this point in the history
	fix(tests): Make tests pass on OS X
  • Loading branch information
guilhermelimak authored Feb 13, 2017
2 parents e3ead15 + 53e30a6 commit 7ab5be0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions __test__/Client.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Client from 'src/Client'
import defaultOptions from 'src/client/defaultOptions'
import Client from 'src/Client.js'
import { defaultOptions } from 'src/client/index.js'

const onSpy = jest.fn()
const sendSpy = jest.fn()
Expand All @@ -9,8 +9,8 @@ const ws = require('ws')

ws.connect = jest.fn(() => ({ on: onSpy, send: sendSpy }))

jest.mock('src/shared')
const shared = require('src/shared')
jest.mock('src/shared/index.js')
const shared = require('src/shared/index.js')

shared.parseMessage = jest.fn()

Expand Down
16 changes: 8 additions & 8 deletions __test__/Server.spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import Server from 'src/Server'
import { ConnectionsList, Connection, defaultOptions } from 'src/server'
import dummyEvent from '__test__/util/dummyEvent'
import dummySocket from '__test__/util/dummySocket'
import Server from 'src/Server.js'
import { ConnectionsList, Connection, defaultOptions } from 'src/server/index.js'
import dummyEvent from '__test__/util/dummyEvent.js'
import dummySocket from '__test__/util/dummySocket.js'

jest.mock('src/shared')
const sharedModules = require('../src/shared')
jest.mock('src/shared/index.js')
const sharedModules = require('../src/shared/index.js')

sharedModules.parseMessage = jest.fn()

jest.mock('src/server')
const serverModules = require('src/server')
jest.mock('src/server/index.js')
const serverModules = require('src/server/index.js')

serverModules.registerClient = jest.fn()

Expand Down
6 changes: 3 additions & 3 deletions __test__/registerClient.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Joi from 'joi'
import { encode } from 'base-64'

import { registerClient } from 'src/server'
import eventSchema from 'src/shared/schemas/eventSchema'
import dummySocket from '__test__/util/dummySocket'
import { registerClient } from 'src/server/index.js'
import eventSchema from 'src/shared/schemas/eventSchema.js'
import dummySocket from '__test__/util/dummySocket.js'

const socket = dummySocket()

Expand Down
2 changes: 1 addition & 1 deletion __test__/splitAndCapitalize.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { splitAndCapitalize } from 'src/util'
import { splitAndCapitalize } from 'src/util/index.js'

describe('splitAndCapitalize.js', () => {
it('should work on pascal case strings', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/Client.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'colors'
import WebSocket from 'ws'

import { Event, parseMessage } from 'src/shared'
import { clientHandlers, defaultOptions } from 'src/client'
import { Event, parseMessage } from 'src/shared/index.js'
import { clientHandlers, defaultOptions } from 'src/client/index.js'

const RETRY_INTERVAl = 1000

Expand Down
2 changes: 1 addition & 1 deletion src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
registerClient,
defaultOptions,
defaultHandlers,
} from 'src/server'
} from 'src/server/index.js'

import { Event, parseMessage } from 'src/shared'

Expand Down

0 comments on commit 7ab5be0

Please sign in to comment.