@abaplint/transpiler 1.6.65 → 1.6.66
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/index.d.ts +2 -2
- package/build/src/index.js +2 -1
- package/build/src/unit_test.d.ts +2 -1
- package/build/src/unit_test.js +11 -7
- package/package.json +4 -4
package/build/src/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface IObjectIdentifier {
|
|
|
15
15
|
export interface IOutput {
|
|
16
16
|
objects: IOutputFile[];
|
|
17
17
|
reg: abaplint.IRegistry;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
unitTestScript: string;
|
|
19
|
+
initializationScript: string;
|
|
20
20
|
databaseSetup: string;
|
|
21
21
|
}
|
|
22
22
|
export interface IRequire {
|
package/build/src/index.js
CHANGED
|
@@ -35,7 +35,8 @@ class Transpiler {
|
|
|
35
35
|
const dbSetup = new database_setup_1.DatabaseSetup(reg).run();
|
|
36
36
|
const output = {
|
|
37
37
|
objects: [],
|
|
38
|
-
|
|
38
|
+
unitTestScript: new unit_test_1.UnitTest().unitTestScript(reg, (_a = this.options) === null || _a === void 0 ? void 0 : _a.skip),
|
|
39
|
+
initializationScript: new unit_test_1.UnitTest().initializationScript(reg, dbSetup),
|
|
39
40
|
databaseSetup: dbSetup,
|
|
40
41
|
reg: reg,
|
|
41
42
|
};
|
package/build/src/unit_test.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare type SkipSettings = {
|
|
|
5
5
|
method: string;
|
|
6
6
|
}[];
|
|
7
7
|
export declare class UnitTest {
|
|
8
|
-
|
|
8
|
+
initializationScript(reg: abaplint.IRegistry, dbSetup: string): string;
|
|
9
|
+
unitTestScript(reg: abaplint.IRegistry, skip?: SkipSettings): string;
|
|
9
10
|
private buildImports;
|
|
10
11
|
}
|
package/build/src/unit_test.js
CHANGED
|
@@ -3,18 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UnitTest = void 0;
|
|
4
4
|
const abaplint = require("@abaplint/core");
|
|
5
5
|
class UnitTest {
|
|
6
|
-
|
|
6
|
+
initializationScript(reg, dbSetup) {
|
|
7
|
+
return `import runtime from "@abaplint/runtime";
|
|
8
|
+
global.abap = new runtime.ABAP();
|
|
9
|
+
${this.buildImports(reg)}
|
|
10
|
+
export async function initDB() {
|
|
11
|
+
return global.abap.initDB(\`${dbSetup}\`);
|
|
12
|
+
}`;
|
|
13
|
+
}
|
|
14
|
+
unitTestScript(reg, skip) {
|
|
7
15
|
let ret = `import fs from "fs";
|
|
8
16
|
import path from "path";
|
|
9
|
-
import runtime from "@abaplint/runtime";
|
|
10
17
|
import {dirname} from 'path';
|
|
11
18
|
import {fileURLToPath} from 'url';
|
|
12
|
-
global.abap = new runtime.ABAP();
|
|
13
|
-
${this.buildImports(reg)}
|
|
14
19
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
20
|
+
import {initDB} from "./init.mjs";
|
|
21
|
+
import runtime from "@abaplint/runtime";
|
|
18
22
|
|
|
19
23
|
async function run() {
|
|
20
24
|
await initDB();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.66",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@abaplint/core": "
|
|
29
|
+
"@abaplint/core": "=2.80.10",
|
|
30
30
|
"source-map": "^0.7.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/mocha": "^9.0.0",
|
|
35
35
|
"chai": "^4.3.4",
|
|
36
36
|
"mocha": "^9.1.3",
|
|
37
|
-
"source-map-support": "^0.5.
|
|
38
|
-
"typescript": "^4.
|
|
37
|
+
"source-map-support": "^0.5.21",
|
|
38
|
+
"typescript": "^4.5.2"
|
|
39
39
|
}
|
|
40
40
|
}
|