From ac89e9eb1c3f95cf518f419a9e793eabae0ec811 Mon Sep 17 00:00:00 2001 From: Sanket Chaudhari Date: Fri, 30 Apr 2021 17:35:47 +0530 Subject: [PATCH] test: add existSync assertions in content check --- lib/generator.test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/generator.test.js b/lib/generator.test.js index 5624626..a55a671 100644 --- a/lib/generator.test.js +++ b/lib/generator.test.js @@ -280,7 +280,7 @@ test("ignore multiple files of certain extension", async() => { }) test("content of explicitly added files from common folder is correct", async() => { - expect.assertions(3) + expect.assertions(9) const s = generator("template", "app", { variables: { @@ -305,4 +305,11 @@ test("content of explicitly added files from common folder is correct", async() expect(fs.readFileSync("app/scripts/three.js", { encoding: "utf8", })).toBe("console.log(\"this is three.js\")") + + expect(fs.existsSync("app/scripts/one.ts")).toBe(false) + expect(fs.existsSync("app/scripts/two.ts")).toBe(false) + expect(fs.existsSync("app/scripts/three.ts")).toBe(false) + expect(fs.existsSync("app/scripts/one.mjs")).toBe(false) + expect(fs.existsSync("app/scripts/two.mjs")).toBe(false) + expect(fs.existsSync("app/scripts/three.mjs")).toBe(false) }) \ No newline at end of file