File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ describe('CLI', () => {
6161 testBin ( '--sockPath /mysockPath' )
6262 . then ( ( output ) => {
6363 expect (
64- output . stdout . includes ( 'http://localhost&sockPath=/mysockPath' )
64+ output . stdout . includes (
65+ `http://localhost?sockPath=${ encodeURIComponent ( '/mysockPath' ) } `
66+ )
6567 ) . toEqual ( true ) ;
6668 done ( ) ;
6769 } )
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ exports[`index should run onSocketMessage['still-ok'] 1`] = `"[WDS] Nothing chan
7474
7575exports [` index should run onSocketMessage['still-ok'] 2` ] = ` "StillOk"` ;
7676
77+ exports [` index should run updatePublicPath 1` ] = `
78+ Array [
79+ "foo",
80+ ]
81+ ` ;
82+
7783exports [` index should set arguments into socket function 1` ] = `
7884Array [
7985 "mock-url",
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ describe('index', () => {
1313 let reloadApp ;
1414 let sendMessage ;
1515 let onSocketMessage ;
16+ let updatePublicPath ;
1617 const locationValue = self . location ;
1718 const resourceQueryValue = global . __resourceQuery ;
1819
@@ -55,6 +56,13 @@ describe('index', () => {
5556 ( ) => 'mock-url'
5657 ) ;
5758
59+ // updatePublicPath
60+ jest . setMock (
61+ '../../client-src/default/utils/updatePublicPath.js' ,
62+ jest . fn ( )
63+ ) ;
64+ updatePublicPath = require ( '../../client-src/default/utils/updatePublicPath' ) ;
65+
5866 require ( '../../client-src/default' ) ;
5967 onSocketMessage = socket . mock . calls [ 0 ] [ 1 ] ;
6068 } ) ;
@@ -215,4 +223,9 @@ describe('index', () => {
215223 expect ( log . log . error . mock . calls [ 0 ] [ 0 ] ) . toMatchSnapshot ( ) ;
216224 expect ( sendMessage . mock . calls [ 0 ] [ 0 ] ) . toMatchSnapshot ( ) ;
217225 } ) ;
226+
227+ test ( 'should run updatePublicPath' , ( ) => {
228+ expect ( updatePublicPath ) . toBeCalled ( ) ;
229+ expect ( updatePublicPath . mock . calls [ 0 ] ) . toMatchSnapshot ( ) ;
230+ } ) ;
218231} ) ;
You can’t perform that action at this time.
0 commit comments