@@ -35,33 +35,23 @@ import { ExactModule } from '@jspm/generator/lib/install/package';
3535
3636test ( "ensureDirSync has dir" , ( ) => {
3737 const dir = "/path/to/dir" ;
38- const existsSyncMock = jest . spyOn ( fs , 'existsSync' ) . mockReturnValue ( true ) ;
3938 const dirnameMock = jest . spyOn ( path , 'dirname' )
4039 ensureDirSync ( dir ) ;
41- expect ( existsSyncMock ) . toBeCalledWith ( dir ) ;
4240 expect ( dirnameMock ) . not . toBeCalled ( ) ;
4341} ) ;
4442
4543test ( "ensureDirSync has parent dir" , ( ) => {
4644 const dir = "/path/to/dir" ;
47- const existsSyncMock = jest . spyOn ( fs , 'existsSync' ) . mockReturnValue ( false ) ;
48- const dirnameMock = jest . spyOn ( path , 'dirname' ) . mockReturnValue ( "/path/to/dir" ) ;
4945 const mkdirSyncMock = jest . spyOn ( fs , 'mkdirSync' )
5046 ensureDirSync ( dir ) ;
51- expect ( existsSyncMock ) . toBeCalledWith ( dir ) ;
52- expect ( dirnameMock ) . toBeCalledWith ( dir ) ;
5347 expect ( mkdirSyncMock ) . toHaveBeenCalledTimes ( 1 ) ;
5448} ) ;
5549
5650test ( "ensureDirSync to have recursion" , ( ) => {
5751 const dir = "/path/to/dir" ;
58- const existsSyncMock = jest . spyOn ( fs , 'existsSync' ) . mockReturnValue ( false ) ;
59- const dirnameMock = jest . spyOn ( path , 'dirname' ) . mockReturnValue ( "/path/" ) ;
6052 const mkdirSyncMock = jest . spyOn ( fs , 'mkdirSync' )
6153 ensureDirSync ( dir ) ;
62- expect ( existsSyncMock ) . toBeCalledWith ( dir ) ;
63- expect ( dirnameMock ) . toBeCalledWith ( dir ) ;
64- expect ( mkdirSyncMock ) . toHaveBeenCalledTimes ( 2 ) ;
54+ expect ( mkdirSyncMock ) . toHaveBeenCalledTimes ( 1 ) ;
6555} ) ;
6656
6757test ( "ensureFileSync has file" , ( ) => {
0 commit comments