This repository has been archived by the owner on Aug 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bigdatr/feature/dont_listen
Feature/dont listen
- Loading branch information
Showing
43 changed files
with
1,442 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib/* linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
require('babel-core/register'); | ||
module.exports = require('./lib/framework'); | ||
module.exports = require('./lib/framework'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
import {expect} from 'chai'; | ||
import sinon from 'sinon'; | ||
import client from '../client'; | ||
'use strict'; | ||
|
||
const payload = 'test'; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
|
||
global.Primus = function() { | ||
var _chai = require('chai'); | ||
|
||
var _sinon = require('sinon'); | ||
|
||
var _sinon2 = _interopRequireDefault(_sinon); | ||
|
||
var _client = require('../client'); | ||
|
||
var _client2 = _interopRequireDefault(_client); | ||
|
||
var payload = 'test'; | ||
|
||
global.Primus = function () { | ||
return { | ||
on(e, cb) { | ||
on: function on(e, cb) { | ||
return cb('payload'); | ||
}, | ||
write: sinon.spy() | ||
write: _sinon2['default'].spy() | ||
}; | ||
}; | ||
|
||
const myStore = { | ||
dispatch: sinon.spy() | ||
var myStore = { | ||
dispatch: _sinon2['default'].spy() | ||
}; | ||
|
||
describe('client', () => { | ||
it('subscribe to redux store', () => { | ||
client.connect(myStore); | ||
describe('client', function () { | ||
it('subscribe to redux store', function () { | ||
_client2['default'].connect(myStore); | ||
|
||
expect(myStore.dispatch.called).to.equal(true); | ||
(0, _chai.expect)(myStore.dispatch.called).to.equal(true); | ||
}); | ||
|
||
it('should dispatch to server and client', () => { | ||
client.dispatch('actionTest'); | ||
it('should dispatch to server and client', function () { | ||
_client2['default'].dispatch('actionTest'); | ||
|
||
expect(myStore.dispatch.calledWith('actionTest')).to.equal(true); | ||
(0, _chai.expect)(myStore.dispatch.calledWith('actionTest')).to.equal(true); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import {expect} from 'chai'; | ||
import sinon from 'sinon'; | ||
import clientSocket from '../clientSocket'; | ||
|
||
describe('clientSocket', () => { | ||
it('should dispatch to the client', () => { | ||
const spark = { | ||
write: sinon.spy() | ||
'use strict'; | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
|
||
var _chai = require('chai'); | ||
|
||
var _sinon = require('sinon'); | ||
|
||
var _sinon2 = _interopRequireDefault(_sinon); | ||
|
||
var _clientSocket = require('../clientSocket'); | ||
|
||
var _clientSocket2 = _interopRequireDefault(_clientSocket); | ||
|
||
describe('clientSocket', function () { | ||
it('should dispatch to the client', function () { | ||
var spark = { | ||
write: _sinon2['default'].spy() | ||
}; | ||
|
||
const client = clientSocket(spark); | ||
var client = (0, _clientSocket2['default'])(spark); | ||
|
||
client.dispatch('myAction'); | ||
|
||
expect(spark.write.calledWith('myAction')).to.equal(true); | ||
(0, _chai.expect)(spark.write.calledWith('myAction')).to.equal(true); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.