-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
44 lines (40 loc) · 770 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import ava from 'ava'
const send = require('./index')
const moment = require('moment')
let redis_conf = {
host: 'localhost',
port: 6379,
password: ''
}
let wechat_param = {
appid : 'your_appid',
appsecret : 'your_appsecret',
touser : 'your_touser',
template_id : 'yuor_template_id',
url : '',
data : {
first : {
value :'标题'
},
performance : {
value : '表现'
},
time : {
value : moment().format('YYYY年MM月DD日 HH时mm分')
},
remark : {
value : '备注'
}
}
}
ava('test send wechat_template', t => {
return send(redis_conf, wechat_param)
.then(body => {
console.log(body)
t.is(body.errcode, 0)
t.is(body.errmsg, 'ok')
})
.catch(err => {
t.fail()
})
})