diff --git a/ts-vitest/fix-jest-dom.mjs b/ts-vitest/fix-jest-dom.mjs index 18bc04e..a2ee7ce 100644 --- a/ts-vitest/fix-jest-dom.mjs +++ b/ts-vitest/fix-jest-dom.mjs @@ -5,7 +5,10 @@ const typesPath = path.resolve('node_modules', '@types', 'testing-library__jest- const refMatcher = /[\r\n]+\/\/\/ /; fs.readFile(typesPath, 'utf8', (err, data) => { - if (err) throw err; + if (err) { + console.warn('\x1b[33m⚠️ this template expects @types/testing-library__jest-dom to be installed, but it is missing.\n Please run:\x1b[0m\n\npnpm i --save-dev @types/testing-library__jest-dom\n'); + return; + } fs.writeFile( typesPath, diff --git a/ts-vitest/package.json b/ts-vitest/package.json index 28d4e41..08d6b03 100644 --- a/ts-vitest/package.json +++ b/ts-vitest/package.json @@ -13,6 +13,7 @@ }, "license": "MIT", "devDependencies": { + "@types/testing-library__jest-dom": "^5.14.3", "@testing-library/jest-dom": "^5.16.5", "jsdom": "^20.0.0", "solid-testing-library": "^0.3.0",