diff --git a/packages/socketio/lib/index.js b/packages/socketio/lib/index.js index 912d8a68c4..03177e19d0 100644 --- a/packages/socketio/lib/index.js +++ b/packages/socketio/lib/index.js @@ -6,7 +6,7 @@ const debug = require('debug')('@feathersjs/socketio'); const socketKey = Symbol('@feathersjs/socketio/socket'); -module.exports = function (port, options, config) { +function configureSocketio (port, options, config) { if (typeof port !== 'number') { config = options; options = port; @@ -99,6 +99,8 @@ module.exports = function (port, options, config) { emit: 'emit' })); }; -}; +} +module.exports = configureSocketio; +module.exports.default = configureSocketio; module.exports.SOCKET_KEY = socketKey; diff --git a/packages/socketio/test/index.test.js b/packages/socketio/test/index.test.js index 7e08011920..77a4af24dc 100644 --- a/packages/socketio/test/index.test.js +++ b/packages/socketio/test/index.test.js @@ -74,6 +74,11 @@ describe('@feathersjs/socketio', () => { server.close(done); }); + it('exports default and SOCKET_KEY', () => { + assert.ok(socketio.SOCKET_KEY); + assert.equal(socketio, socketio.default); + }); + it('throws an error when using an incompatible version of Feathers', () => { const oldFeathers = require('feathers');