From 10663c28a0598023b816e47bc316854c79d5e7ec Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Fri, 27 Nov 2015 12:40:05 -0700 Subject: [PATCH] Fixes exports and tests correct build exports. --- package.json | 2 +- src/sockets/index.js | 5 ++++- test/base.js | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6c54ff6..0713bf7 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "watch": "babel --watch -d lib/ src/", "jshint": "jshint src/. test/. --config", "mocha": "mocha test/ --compilers js:babel-core/register --recursive --timeout 5000", - "test": "npm run jshint && npm run mocha" + "test": "npm run compile && npm run jshint && npm run mocha" }, "directories": { "lib": "lib" diff --git a/src/sockets/index.js b/src/sockets/index.js index 39f0eeb..38337af 100644 --- a/src/sockets/index.js +++ b/src/sockets/index.js @@ -19,4 +19,7 @@ function socketio(socket) { return base(socket); } -export { socketio, base as primus }; +export default { + socketio, + primus: base +}; \ No newline at end of file diff --git a/test/base.js b/test/base.js index d25893d..ba03a0f 100644 --- a/test/base.js +++ b/test/base.js @@ -78,5 +78,13 @@ module.exports = function(service) { done(); }); }); + + it('is built correctly', () => { + assert.equal(typeof require('../lib/client'), 'function'); + assert.equal(typeof require('../lib/client').jquery, 'function'); + assert.equal(typeof require('../lib/client').request, 'function'); + assert.equal(typeof require('../lib/client').socketio, 'function'); + assert.equal(typeof require('../lib/client').primus, 'function'); + }); }); };