e2ed
Version:
E2E testing framework over Playwright
25 lines (24 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getShouldRunTest = void 0;
const generalLog_1 = require("../generalLog");
const notIncludedInPackTests_1 = require("../notIncludedInPackTests");
const uiMode_1 = require("../uiMode");
const getIsTestIncludedInPack_1 = require("./getIsTestIncludedInPack");
/**
* Returns `true`, if test should be run, and `false` otherwise.
* @internal
*/
const getShouldRunTest = async (testStaticOptions) => {
const isTestIncludedInPack = (0, getIsTestIncludedInPack_1.getIsTestIncludedInPack)(testStaticOptions);
if (!isTestIncludedInPack) {
await (0, notIncludedInPackTests_1.addTestToNotIncludedInPackTests)(testStaticOptions.filePath);
return false;
}
if (uiMode_1.isUiMode) {
return true;
}
const successfulTestFilePaths = await (0, generalLog_1.getSuccessfulTestFilePaths)();
return !successfulTestFilePaths.includes(testStaticOptions.filePath);
};
exports.getShouldRunTest = getShouldRunTest;