artes
Version:
The simplest way to automate UI and API tests using Cucumber-style steps.
31 lines (27 loc) โข 730 B
JavaScript
const { spawnSync } = require("child_process");
const { moduleConfig } = require("../imports/commons");
function runTests() {
try {
console.log("๐งช Running tests...");
process.env.FORCE_COLOR = "1";
process.env.FORCE_STDIO_TTY = "1";
spawnSync("cucumber-js", ["--config=cucumber.config.js"], {
cwd: moduleConfig.modulePath,
stdio: "inherit",
shell: true,
env: {
...process.env,
FORCE_TTY: "1",
FORCE_COLOR: "1",
CI: "false",
},
});
console.log("โ
Tests running completed successfully!");
} catch (error) {
console.error("โ Test execution failed:", error);
process.env.EXIT_CODE = 1;
}
}
module.exports = {
runTests,
};