File tree 3 files changed +1280
-39
lines changed 3 files changed +1280
-39
lines changed Original file line number Diff line number Diff line change 12
12
"homepage" : " https://github.com/vkalinichev/rutor-api" ,
13
13
"main" : " lib/index.js" ,
14
14
"dependencies" : {
15
+ "ava" : " ^0.17.0" ,
15
16
"cheerio" : " ^0.22.0" ,
16
17
"request" : " ^2.79.0"
17
18
},
26
27
"build" : " babel src -d lib" ,
27
28
"prepublish" : " npm run build && npm test" ,
28
29
"lint" : " eslint lib/*.js" ,
29
- "test" : " echo \" Error: no test specified \" && exit 1 "
30
+ "test" : " ava "
30
31
},
31
32
"engines" : {
32
33
"node" : " >=4"
Original file line number Diff line number Diff line change
1
+ const { test } = require ( 'ava' )
2
+ const { config } = require ( '.' )
3
+
4
+ test ( 'Default config loaded' , t => {
5
+ const actual = config ( { } )
6
+ const expected = {
7
+ base : 'http://tor-ru.net/search/' ,
8
+ page : 0 ,
9
+ category : 0 ,
10
+ method : 100 ,
11
+ order : 0
12
+ }
13
+ t . deepEqual ( actual , expected )
14
+ } )
15
+
16
+ test ( 'Explicit config overrides defaults' , t => {
17
+ const actual = config ( { base : 'http://rutor.org/search/' } )
18
+ const expected = {
19
+ base : 'http://rutor.org/search/' ,
20
+ page : 0 ,
21
+ category : 0 ,
22
+ method : 100 ,
23
+ order : 0
24
+ }
25
+ t . deepEqual ( actual , expected )
26
+ } )
27
+
You can’t perform that action at this time.
0 commit comments