generated from forcedotcom/dx-empty
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathparsePR.js
More file actions
24 lines (20 loc) · 762 Bytes
/
parsePR.js
File metadata and controls
24 lines (20 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const fs = require("fs");
const readline = require("readline");
async function extractTests() {
//by default we specify that all tests should run
let testsFile = __dirname + "/testsToRun.txt";
await fs.promises.writeFile(testsFile, "all");
const lines = readline.createInterface({
input: fs.createReadStream(__dirname + "/pr_body.txt"),
crlfDelay: Infinity
});
for await (const line of lines) {
//special delimeter for apex tests
if (line.includes("Apex::[") && line.includes("]::Apex")) {
let tests = line.substring(8, line.length - 7);
await fs.promises.writeFile(testsFile, tests);
await fs.promises.appendFile(testsFile, "\n");
}
}
}
extractTests();