File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ node_modules/
3
3
/packages /* /build /
4
4
/packages /* /build-module /
5
5
/packages /* /build-browser /
6
+
7
+ coverage /
Original file line number Diff line number Diff line change 6
6
"babel-preset-env" : " ^1.5.2" ,
7
7
"chalk" : " ^1.1.3" ,
8
8
"glob" : " ^7.1.2" ,
9
+ "jest" : " ^20.0.4" ,
9
10
"lerna" : " ^2.0.0-rc.5" ,
10
11
"mkdirp" : " ^0.5.1" ,
11
12
"rimraf" : " ^2.6.1"
12
13
},
13
14
"scripts" : {
14
15
"build-clean" : " rimraf ./packages/*/build ./packages/*/build-browser ./packages/*/build-module" ,
15
- "build" : " node ./scripts/build.js"
16
+ "build" : " node ./scripts/build.js" ,
17
+ "test" : " jest" ,
18
+ "watch" : " jest --watch"
16
19
}
17
20
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Internal Dependencies
3
+ */
4
+ import { addQueryArgs } from '../' ;
5
+
6
+ describe ( 'addQueryArgs' , ( ) => {
7
+ test ( 'should append args to an URL without query string' , ( ) => {
8
+ const url = 'https://andalouses.com/beach' ;
9
+ const args = { sun : 'true' , sand : 'false' } ;
10
+
11
+ expect ( addQueryArgs ( url , args ) ) . toBe ( 'https://andalouses.com/beach?sun=true&sand=false' ) ;
12
+ } ) ;
13
+
14
+ test ( 'should append args to an URL with query string' , ( ) => {
15
+ const url = 'https://andalouses.com/beach?night=false' ;
16
+ const args = { sun : 'true' , sand : 'false' } ;
17
+
18
+ expect ( addQueryArgs ( url , args ) ) . toBe ( 'https://andalouses.com/beach?night=false&sun=true&sand=false' ) ;
19
+ } ) ;
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments