From f9cd4db4e12c424ccd0a4c6146e5e0c7241e04a3 Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Wed, 23 Jan 2019 10:39:59 +0100 Subject: [PATCH] More verbose test logging --- .circleci/config.yml | 2 +- testscripts/mockobjects.js | 20 ++++++++++---------- testscripts/musicTest.js | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 270c801..a28047a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2 jobs: - build: + build_and_test: docker: # specify the version you desire here - image: circleci/node:10.11 diff --git a/testscripts/mockobjects.js b/testscripts/mockobjects.js index db66e94..cd34cdf 100644 --- a/testscripts/mockobjects.js +++ b/testscripts/mockobjects.js @@ -1,9 +1,9 @@ exports.mockDispatcher = { - pause: () => console.log('pause();'), - resume: () => console.log('resume();'), - setVolume: (perc) => console.log(`setVolume(${perc});`), - on: (event, callback) => console.log(`on(${event}, ${callback});`), - end: () => console.log('end();') + pause: () => console.log('Dispatcher.pause();'), + resume: () => console.log('Dispatcher.resume();'), + setVolume: (perc) => console.log(`Dispatcher.setVolume(${perc});`), + on: (event, callback) => console.log(`Dispatcher.on(${event}, ${callback});`), + end: () => console.log('Dispatcher.end();') }; exports.mockConnection = { @@ -11,24 +11,24 @@ exports.mockConnection = { members: { size: 10 }, - leave: () => console.log('leave();') + leave: () => console.log('Connection.leave();') }, status: 0, playFile: (fname) => { - console.log(`playFile(${fname});`); + console.log(`Connection.playFile(${fname});`); return exports.mockDispatcher; }, playStream: (stream, opts) => { - console.log(`playStream(ytdl, ${opts};`); + console.log(`Connection.playStream(ytdl, ${opts};`); return exports.mockDispatcher; }, - disconnect: () => console.log('disconnect();') + disconnect: () => console.log('Connection.disconnect();') }; exports.mockVoicechannel = { name: 'mockVoicechannel', join: () => { - console.log('join();'); + console.log('Voicechannel.join();'); return new Promise((rs, rj) => rs(exports.mockConnection)); }, members: { diff --git a/testscripts/musicTest.js b/testscripts/musicTest.js index fe9f801..7212711 100644 --- a/testscripts/musicTest.js +++ b/testscripts/musicTest.js @@ -4,11 +4,11 @@ const music = require('../lib/music.js'), function main() { let dj = new music.DJ(mockclasses.mockVoicechannel) music.setLogger({ - error: () => {}, - warn: () => {}, - info: () => {}, - verbose: () => {}, - debug: () => {} + error: (msg) => console.error('error: ', msg), + warn: (msg) => console.error('warn: ', msg), + info: (msg) => console.log('info: ', msg), + verbose: (msg) => console.log('verbose: ', msg), + debug: (msg) => console.log('debug: ', msg) }); dj.connect().then(() => { console.log('connected', dj.connected); @@ -20,8 +20,8 @@ function main() { dj.skip(); dj.stop(); dj.shuffle(); - console.log(dj.playlist); - console.log(dj.song); + console.log('dj.playlist: ', dj.playlist); + console.log('dj.song: ', dj.song); dj.clear(); process.exit(0); });