diff --git a/lib/tasks/jsdoc/generateJsdoc.js b/lib/tasks/jsdoc/generateJsdoc.js index df053feec..644431196 100644 --- a/lib/tasks/jsdoc/generateJsdoc.js +++ b/lib/tasks/jsdoc/generateJsdoc.js @@ -70,7 +70,9 @@ async function createTmpDirs(projectName) { const {path: tmpDirPath} = await createTmpDir(projectName); const sourcePath = path.join(tmpDirPath, "src"); // dir will be created by writing project resources below + await makeDir(sourcePath, {fs}); const targetPath = path.join(tmpDirPath, "target"); // dir will be created by jsdoc itself + await makeDir(targetPath, {fs}); const tmpPath = path.join(tmpDirPath, "tmp"); // dir needs to be created by us await makeDir(tmpPath, {fs}); diff --git a/test/lib/tasks/jsdoc/generateJsdoc.js b/test/lib/tasks/jsdoc/generateJsdoc.js index 816bc07cf..03f96486d 100644 --- a/test/lib/tasks/jsdoc/generateJsdoc.js +++ b/test/lib/tasks/jsdoc/generateJsdoc.js @@ -49,8 +49,13 @@ test.serial("createTmpDirs", async (t) => { targetPath: path.join("/", "some", "path", "target"), tmpPath: path.join("/", "some", "path", "tmp") }, "Correct temporary directories returned"); - t.deepEqual(makeDirStub.callCount, 1, "One directory got created"); - t.deepEqual(makeDirStub.getCall(0).args[0], path.join("/", "some", "path", "tmp"), "Correct dir path got created"); + t.deepEqual(makeDirStub.callCount, 3, "One directory got created"); + t.deepEqual(makeDirStub.getCall(0).args[0], path.join("/", "some", "path", "src"), + "Correct srcdir path got created"); + t.deepEqual(makeDirStub.getCall(1).args[0], path.join("/", "some", "path", "target"), + "Correct target dir path got created"); + t.deepEqual(makeDirStub.getCall(2).args[0], path.join("/", "some", "path", "tmp"), + "Correct tmp dir path got created"); mock.stop("make-dir"); });