diff --git a/create-turbo/__tests__/cli.test.ts b/create-turbo/__tests__/cli.test.ts index d746e0ea58947..39aef4d5b6239 100644 --- a/create-turbo/__tests__/cli.test.ts +++ b/create-turbo/__tests__/cli.test.ts @@ -36,7 +36,7 @@ describe("create-turbo cli", () => { jest.setTimeout(DEFAULT_JEST_TIMEOUT); }); - it("guides the user through the process", async () => { + it("guides the user through the process", (done) => { let cli = spawn("node", [createTurbo], {}); let promptCount = 0; let previousPrompt: string; @@ -89,6 +89,12 @@ describe("create-turbo cli", () => { }); cli.on("exit", () => { + try { + expect(promptCount).toEqual(4); + done(); + } catch (error) { + done(error); + } return; }); }); diff --git a/create-turbo/jest.config.js b/create-turbo/jest.config.js index 21a1e973aba82..917deee446673 100644 --- a/create-turbo/jest.config.js +++ b/create-turbo/jest.config.js @@ -1,5 +1,6 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ module.exports = { - preset: "ts-jest", + preset: "ts-jest/presets/js-with-ts", testEnvironment: "node", + transformIgnorePatterns: ["/node_modules/(?!(strip-ansi|ansi-regex)/)"], }; diff --git a/create-turbo/tsconfig.json b/create-turbo/tsconfig.json index 89ca97e83171f..f097aac870ff1 100644 --- a/create-turbo/tsconfig.json +++ b/create-turbo/tsconfig.json @@ -11,6 +11,7 @@ "resolveJsonModule": true, "esModuleInterop": true, "outDir": "dist", - "rootDir": "." + "rootDir": ".", + "allowJs": true } }