diff --git a/server/distribute/export.js b/server/distribute/export.js index 7eeda14c..a9e1d719 100644 --- a/server/distribute/export.js +++ b/server/distribute/export.js @@ -36,7 +36,7 @@ const omitList = [ 'configDialog', ]; -const omitConfig = wraptile((config) => omit(config, omitList)); +const omitConfig = (config) => omit(config, omitList); module.exports = (socket) => { if (!config('export')) diff --git a/server/distribute/export.spec.js b/server/distribute/export.spec.js index 7fc2a5ab..0d50061a 100644 --- a/server/distribute/export.spec.js +++ b/server/distribute/export.spec.js @@ -43,3 +43,33 @@ test('distribute: export', async (t) => { }); }); +test('distribute: export: config', async (t) => { + const defaultConfig = { + export: true, + exportToken: 'a', + vim: true, + log: false, + }; + + const {port, done} = await connect({ + config: defaultConfig + }); + + const url = `http://localhost:${port}/distribute?port=${1111}`; + const socket = io.connect(url); + + const name = config('name'); + + socket.on('connect', () => { + socket.emit('auth', 'a'); + }); + + socket.on('config', async (data) => { + socket.close(); + await done(); + + t.equal(typeof data, 'object', 'should emit object'); + t.end(); + }); +}); +