11import { promises as fs } from 'fs' ;
2- import makeDir from 'make-dir' ;
32import touch from 'touch' ;
43import camelcase from 'camelcase' ;
54import mustache from 'mustache' ;
@@ -25,7 +24,6 @@ describe('package build details', () => {
2524 const projectRoot = any . string ( ) ;
2625 const projectName = any . word ( ) ;
2726 const pathToExample = `${ projectRoot } /example.js` ;
28- const pathToCreatedSrcDirectory = any . string ( ) ;
2927 const bundlerResults = any . simpleObject ( ) ;
3028 const exampleContent = any . string ( ) ;
3129 const pathToExampleTemplate = any . string ( ) ;
@@ -35,7 +33,6 @@ describe('package build details', () => {
3533 const decisions = any . simpleObject ( ) ;
3634
3735 beforeEach ( ( ) => {
38- when ( makeDir ) . calledWith ( `${ projectRoot } /src` ) . mockResolvedValue ( pathToCreatedSrcDirectory ) ;
3936 when ( templatePath ) . calledWith ( 'example.mustache' ) . mockReturnValue ( pathToExampleTemplate ) ;
4037 when ( fs . readFile ) . calledWith ( pathToExampleTemplate , 'utf8' ) . mockResolvedValue ( exampleTemplateContent ) ;
4138 when ( camelcase ) . calledWith ( projectName ) . mockReturnValue ( camelizedProjectName ) ;
@@ -101,7 +98,8 @@ describe('package build details', () => {
10198 buildDirectory : 'lib' ,
10299 badges : { consumer : { } }
103100 } ) ;
104- expect ( touch ) . toHaveBeenCalledWith ( `${ pathToCreatedSrcDirectory } /index.js` ) ;
101+ expect ( fs . mkdir ) . toHaveBeenCalledWith ( `${ projectRoot } /src` , { recursive : true } ) ;
102+ expect ( touch ) . toHaveBeenCalledWith ( `${ projectRoot } /src/index.js` ) ;
105103 expect ( fs . writeFile ) . toHaveBeenCalledWith ( pathToExample , exampleContent ) ;
106104 } ) ;
107105
0 commit comments