@abaplint/transpiler 1.7.9 → 1.7.10
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/build/src/unit_test.js +11 -5
- package/package.json +1 -1
package/build/src/unit_test.js
CHANGED
|
@@ -5,12 +5,18 @@ const abaplint = require("@abaplint/core");
|
|
|
5
5
|
class UnitTest {
|
|
6
6
|
// todo, move this somewhere else, its much more than just unit test relevant
|
|
7
7
|
initializationScript(reg, dbSetup) {
|
|
8
|
-
|
|
8
|
+
let ret = `import runtime from "@abaplint/runtime";
|
|
9
9
|
global.abap = new runtime.ABAP();
|
|
10
10
|
${this.buildImports(reg)}
|
|
11
|
-
export async function initializeABAP(settings) {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export async function initializeABAP(settings) {\n`;
|
|
12
|
+
if (dbSetup === "") {
|
|
13
|
+
ret += `// no database artifacts, skip DB initialization\n`;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
ret += ` await global.abap.initDB(\`${dbSetup}\`);\n`;
|
|
17
|
+
}
|
|
18
|
+
ret += `}`;
|
|
19
|
+
return ret;
|
|
14
20
|
}
|
|
15
21
|
unitTestScript(reg, skip, _only) {
|
|
16
22
|
let ret = `import fs from "fs";
|
|
@@ -84,7 +90,7 @@ fs.writeFileSync(__dirname + path.sep + "output.xml", unit.xUnitXML());
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
run().then(() => {
|
|
87
|
-
process.exit();
|
|
93
|
+
process.exit(0);
|
|
88
94
|
}).catch((err) => {
|
|
89
95
|
console.log(err);
|
|
90
96
|
process.exit(1);
|