@empiricalrun/test-run 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/dashboard.js +1 -1
- package/dist/run-specific-test.d.ts.map +1 -1
- package/dist/run-specific-test.js +17 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/dashboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,wBAAwB,QAAa,QAAQ;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,wBAAwB,QAAa,QAAQ;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CA6BA,CAAC"}
|
package/dist/dashboard.js
CHANGED
|
@@ -14,7 +14,7 @@ const fetchEnvironmentAndBuild = async () => {
|
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
if (!resp.ok) {
|
|
17
|
-
throw new Error(`Failed to fetch environment
|
|
17
|
+
throw new Error(`Failed to fetch environment from dashboard for project: ${projectRepo} and env slug: ${environmentSlug}. Use PROJECT_NAME and TEST_RUN_ENVIRONMENT env vars to set these values correctly.`);
|
|
18
18
|
}
|
|
19
19
|
const data = (await resp.json());
|
|
20
20
|
return data.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-specific-test.d.ts","sourceRoot":"","sources":["../src/run-specific-test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAY5C;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,GAAG,EACH,SAAS,EACT,QAAQ,GACT,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC,
|
|
1
|
+
{"version":3,"file":"run-specific-test.d.ts","sourceRoot":"","sources":["../src/run-specific-test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAY5C;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,GAAG,EACH,SAAS,EACT,QAAQ,GACT,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC,CAwED"}
|
|
@@ -37,6 +37,23 @@ async function runSpecificTest({ name, dir, pwOptions, platform, }) {
|
|
|
37
37
|
console.log("Is parent describe block marked serial:", !!parentDescribe);
|
|
38
38
|
console.log("Is file marked serial:", isFileMarkedSerial);
|
|
39
39
|
const currentFileContent = await fs_extra_1.default.readFile(matchingFilePath, "utf-8");
|
|
40
|
+
const revertFileContent = () => {
|
|
41
|
+
fs_extra_1.default.writeFileSync(matchingFilePath, currentFileContent);
|
|
42
|
+
};
|
|
43
|
+
// revert the changes made to the file to mark tests as only
|
|
44
|
+
// these needs to handle by listening to process exit/kill events
|
|
45
|
+
process.on("beforeExit", () => {
|
|
46
|
+
revertFileContent();
|
|
47
|
+
});
|
|
48
|
+
process.on("exit", () => {
|
|
49
|
+
revertFileContent();
|
|
50
|
+
});
|
|
51
|
+
process.on("SIGINT", () => {
|
|
52
|
+
revertFileContent();
|
|
53
|
+
});
|
|
54
|
+
process.on("SIGTERM", () => {
|
|
55
|
+
revertFileContent();
|
|
56
|
+
});
|
|
40
57
|
// if the file is not marked serial, we need to mark the test or describe block as only
|
|
41
58
|
if (!isFileMarkedSerial && testCaseNode) {
|
|
42
59
|
await (0, utils_1.markTestAsOnly)({
|
|
@@ -59,8 +76,6 @@ async function runSpecificTest({ name, dir, pwOptions, platform, }) {
|
|
|
59
76
|
catch (e) {
|
|
60
77
|
hasTestPassed = false;
|
|
61
78
|
}
|
|
62
|
-
// revert the changes made to the file to mark tests as only
|
|
63
|
-
await fs_extra_1.default.writeFile(matchingFilePath, currentFileContent);
|
|
64
79
|
return {
|
|
65
80
|
hasTestPassed,
|
|
66
81
|
};
|