目前,我使用的环境变量会修改config.js(而不是json ... yup),从而允许运行单个测试。为此有更标准的命令吗?
const single = process.env.single ? `+(${process.env.single}.)+` : "";
module.exports = {
rootDir: "../",
setupTestFrameworkScriptFile: "./e2e/init.js",
preset: "react-native",
verbose: true,
transform: {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
},
testMatch: ["**/?(*.)" + single + "(spec|test).js?(x)"]
};