diff --git a/example/app.js b/example/app.js index 1a0a29e..49ef728 100644 --- a/example/app.js +++ b/example/app.js @@ -5,4 +5,4 @@ const app = require('@rokid/ams')(); app.on('request', (data) => { // handler }); -app.start(); +app.start(); \ No newline at end of file diff --git a/example/tests/cloud-confirm.spec.js b/example/tests/cloud-confirm.spec.js index 1ce5980..d9eab03 100644 --- a/example/tests/cloud-confirm.spec.js +++ b/example/tests/cloud-confirm.spec.js @@ -8,36 +8,40 @@ test('test 7 play', (t) => { 'intent': 'play_random', 'pattern': '^$iwant?$play$one?$keyword$', 'slots': {} - }, { - 'appId':'RCAC74F187F34C94B93EE3BAECFCE2E3', - 'response': { + }, { + 'appId': 'RCAC74F187F34C94B93EE3BAECFCE2E3', + 'response': { 'action': { 'version': '2.0.0', 'type': 'NORMAL', 'form': 'scene', 'shouldEndSession': true, 'directives': [{ - 'type':'voice', + 'type': 'voice', 'action': 'PLAY', - 'disableEvent':false, + 'disableEvent': false, 'item': { - 'itemId':'newstestitemid', + 'itemId': 'newstestitemid', 'tts': '晚上好,若琪为您播放晚间新闻摘要,首先我们来看看社会新闻。' } }, { - 'type':'confirm', + 'type': 'confirm', 'confirmIntent': 'nlp intent to confirm', 'confirmSlot': 'nlp slot to confirm', 'optionWords': ['word1', 'word2'] }] } }, - 'startWithActiveWord':false, - 'version':'2.0.0' + 'startWithActiveWord': false, + 'version': '2.0.0' }); Promise.all([ - t.assert('Voice.FINISHED', {voice: {item: 'newstestitemid'}}), + t.assert('Voice.FINISHED', { + voice: { + item: 'newstestitemid' + } + }), t.assert('siren.statechange', 'open'), ]).then(() => { t.done(); diff --git a/lib/executor.js b/lib/executor.js index 2d359cb..16fad84 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -9,6 +9,7 @@ const asserts = []; const filter = process.argv[2]; const redify = (text) => '\033[31m' + text + '\033[0m'; const greyify = (text) => '\033[1;30m' + text + '\033[0m'; +const yellowify = (text) => '\033[33m' + text + '\033[0m'; const greenify = (text) => '\033[32m' + text + '\033[0m'; class TestCase { @@ -149,11 +150,11 @@ dispatcher.on('line', (line) => { } const item = asserts[0]; if (!item) { - console.info(greyify(` .skip ${name} ${JSON.stringify(val)}`)); + console.info(yellowify(` .skip ${name} ${JSON.stringify(val)}`)); return; } if (item.name !== name) { - console.info(greyify(` .skip ${name} ${JSON.stringify(val)}`)); + console.info(yellowify(` .skip ${name} ${JSON.stringify(val)}`)); return; } asserts.shift();