fix(distribute) export: config

This commit is contained in:
coderaiser 2018-09-21 18:41:49 +03:00
parent 2d7722c19f
commit 0c5bde5a89
2 changed files with 31 additions and 1 deletions

View file

@ -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'))

View file

@ -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();
});
});