feat(tests): support custom test to run

This commit is contained in:
Alexey Kasyanchuk 2021-06-16 01:03:47 +03:00
parent a4f90519d3
commit 0e79ce42ca

View File

@ -10,7 +10,7 @@ const tempDir = jetpack.cwd("temp");
const entryFilePath = tempDir.path("testsInit.js");
const testsImports = testsDir
.find({ matching: "*.test.js" })
.find({ matching: process.env.TEST ? `${process.env.TEST}.test.js` : "*.test.js" })
.reduce((fileContent, path) => {
const normalizedPath = path.replace(/\\/g, "/");
return `${fileContent}require("../tests/${normalizedPath}");\n`;