From ced55fe40935bb22ebd3b6b22d70cd27c9ea08f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E6=9C=A8?= Date: Mon, 5 Feb 2018 10:20:55 +0800 Subject: [PATCH] format example code --- example/app.js | 2 +- example/tests/cloud-confirm.spec.js | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) 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();