Skip to content

Commit 13ba6fc

Browse files
committed
test: add test
1 parent b86004d commit 13ba6fc

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"standard"
66
],
77
"env": {
8-
"node": true
8+
"node": true,
9+
"es6": true
910
}
1011
}

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
3+
node_js:
4+
- 4
5+
- 5
6+
- 6

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lib"
1313
],
1414
"scripts": {
15-
"test": "echo \"Error: no test specified\" && exit 1"
15+
"test": "eslint . && ava"
1616
},
1717
"keywords": [
1818
"translate",
@@ -35,6 +35,7 @@
3535
"xml2json": "^0.10.0"
3636
},
3737
"devDependencies": {
38+
"ava": "^0.16.0",
3839
"eslint": "^3.6.1",
3940
"eslint-config-standard": "^6.1.0",
4041
"eslint-plugin-promise": "^2.0.1",

test/test.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict'
2+
3+
import test from 'ava'
4+
import suoxie from '../lib'
5+
6+
test('main query', t => {
7+
suoxie('internationalization')
8+
.then(rst => {
9+
t.truthy(rst)
10+
t.is(typeof rst, 'object')
11+
12+
t.truthy(rst.results.result)
13+
t.is(Object.prototype.toString.call(rst.results.result), '[object Array]')
14+
15+
t.is(rst.results.result.term, 'I18N')
16+
})
17+
})

0 commit comments

Comments
 (0)