@intuitionrobotics/testelot 0.47.59 → 1.0.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/LICENSE +3 -0
- package/README.md +3 -0
- package/{core → dist/core}/Action.d.ts +7 -4
- package/dist/core/Action.d.ts.map +1 -0
- package/dist/core/Action.js +214 -0
- package/dist/core/Action.js.map +1 -0
- package/{core → dist/core}/Action_Container.d.ts +6 -3
- package/dist/core/Action_Container.d.ts.map +1 -0
- package/dist/core/Action_Container.js +97 -0
- package/dist/core/Action_Container.js.map +1 -0
- package/{core → dist/core}/Action_Custom.d.ts +2 -1
- package/dist/core/Action_Custom.d.ts.map +1 -0
- package/dist/core/Action_Custom.js +32 -0
- package/dist/core/Action_Custom.js.map +1 -0
- package/{core → dist/core}/Action_Http.d.ts +2 -1
- package/dist/core/Action_Http.d.ts.map +1 -0
- package/dist/core/Action_Http.js +181 -0
- package/dist/core/Action_Http.js.map +1 -0
- package/{core → dist/core}/Action_Log.d.ts +2 -1
- package/dist/core/Action_Log.d.ts.map +1 -0
- package/dist/core/Action_Log.js +36 -0
- package/dist/core/Action_Log.js.map +1 -0
- package/{core → dist/core}/Action_Sleep.d.ts +2 -1
- package/dist/core/Action_Sleep.d.ts.map +1 -0
- package/dist/core/Action_Sleep.js +34 -0
- package/dist/core/Action_Sleep.js.map +1 -0
- package/{core → dist/core}/Action_ThrowException.d.ts +2 -1
- package/dist/core/Action_ThrowException.d.ts.map +1 -0
- package/dist/core/Action_ThrowException.js +33 -0
- package/dist/core/Action_ThrowException.js.map +1 -0
- package/{core → dist/core}/ContainerContext.d.ts +1 -0
- package/dist/core/ContainerContext.d.ts.map +1 -0
- package/{core → dist/core}/ContainerContext.js +5 -10
- package/dist/core/ContainerContext.js.map +1 -0
- package/{core → dist/core}/Reporter.d.ts +2 -1
- package/dist/core/Reporter.d.ts.map +1 -0
- package/{core → dist/core}/Reporter.js +36 -40
- package/dist/core/Reporter.js.map +1 -0
- package/{core → dist/core}/Scenario.d.ts +2 -1
- package/dist/core/Scenario.d.ts.map +1 -0
- package/dist/core/Scenario.js +31 -0
- package/dist/core/Scenario.js.map +1 -0
- package/{core → dist/core}/TestException.d.ts +1 -0
- package/dist/core/TestException.d.ts.map +1 -0
- package/{core → dist/core}/TestException.js +2 -6
- package/dist/core/TestException.js.map +1 -0
- package/{core → dist/core}/_base_apis.d.ts +3 -2
- package/dist/core/_base_apis.d.ts.map +1 -0
- package/dist/core/_base_apis.js +81 -0
- package/dist/core/_base_apis.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/{test-app → dist/test-app}/AppTester.d.ts +2 -1
- package/dist/test-app/AppTester.d.ts.map +1 -0
- package/dist/test-app/AppTester.js +47 -0
- package/dist/test-app/AppTester.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +23 -12
- package/core/Action.js +0 -210
- package/core/Action.js.map +0 -1
- package/core/Action_Container.js +0 -112
- package/core/Action_Container.js.map +0 -1
- package/core/Action_Custom.js +0 -46
- package/core/Action_Custom.js.map +0 -1
- package/core/Action_Http.js +0 -197
- package/core/Action_Http.js.map +0 -1
- package/core/Action_Log.js +0 -48
- package/core/Action_Log.js.map +0 -1
- package/core/Action_Sleep.js +0 -48
- package/core/Action_Sleep.js.map +0 -1
- package/core/Action_ThrowException.js +0 -47
- package/core/Action_ThrowException.js.map +0 -1
- package/core/ContainerContext.js.map +0 -1
- package/core/Reporter.js.map +0 -1
- package/core/Scenario.js +0 -44
- package/core/Scenario.js.map +0 -1
- package/core/TestException.js.map +0 -1
- package/core/_base_apis.js +0 -99
- package/core/_base_apis.js.map +0 -1
- package/index.d.ts +0 -13
- package/index.js +0 -47
- package/index.js.map +0 -1
- package/test-app/AppTester.js +0 -59
- package/test-app/AppTester.js.map +0 -1
package/core/Action_Container.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_Container = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_1 = require("./Action");
|
|
34
|
-
const ContainerContext_1 = require("./ContainerContext");
|
|
35
|
-
class Action_Container extends Action_1.Action {
|
|
36
|
-
constructor(type, tag) {
|
|
37
|
-
super(type, tag);
|
|
38
|
-
this.context = new ContainerContext_1.TypedHashMap();
|
|
39
|
-
this.actions = [];
|
|
40
|
-
this.isProxy = false;
|
|
41
|
-
}
|
|
42
|
-
isContainer() {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
add(...steps) {
|
|
46
|
-
this.actions.push(...steps);
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
setProxy(isProxy) {
|
|
50
|
-
this.isProxy = isProxy;
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
get(key) {
|
|
54
|
-
if (this.isProxy)
|
|
55
|
-
return super.get(key);
|
|
56
|
-
const value = this.context.get(key);
|
|
57
|
-
if (value)
|
|
58
|
-
return value;
|
|
59
|
-
return super.get(key);
|
|
60
|
-
}
|
|
61
|
-
remove(key) {
|
|
62
|
-
if (this.isProxy)
|
|
63
|
-
return super.remove(key);
|
|
64
|
-
const value = this.context.delete(key);
|
|
65
|
-
if (value)
|
|
66
|
-
return value;
|
|
67
|
-
return super.remove(key);
|
|
68
|
-
}
|
|
69
|
-
set(key, value) {
|
|
70
|
-
if (this.isProxy)
|
|
71
|
-
return super.set(key, value);
|
|
72
|
-
this.logDebug(` Storing: ${key.key} => ${JSON.stringify(value)}`);
|
|
73
|
-
const prevValue = this.context.get(key);
|
|
74
|
-
this.context.set(key, value);
|
|
75
|
-
return prevValue;
|
|
76
|
-
}
|
|
77
|
-
getSteps() {
|
|
78
|
-
return this.actions;
|
|
79
|
-
}
|
|
80
|
-
reset() {
|
|
81
|
-
this.context.clear();
|
|
82
|
-
super.reset();
|
|
83
|
-
this.actions.forEach(action => action.reset());
|
|
84
|
-
}
|
|
85
|
-
execute() {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
for (const action of this.actions) {
|
|
88
|
-
if (this.status !== Action_1.Status.Running)
|
|
89
|
-
action.setStatus(Action_1.Status.Skipped);
|
|
90
|
-
yield this._executeSubAction(action);
|
|
91
|
-
if (action.status !== Action_1.Status.Error)
|
|
92
|
-
continue;
|
|
93
|
-
// noinspection FallThroughInSwitchStatementJS
|
|
94
|
-
switch (action.policy) {
|
|
95
|
-
case 0 /* ErrorPolicy.ContinueOnError */:
|
|
96
|
-
continue;
|
|
97
|
-
case 2 /* ErrorPolicy.HaltOnError */:
|
|
98
|
-
this.setErrorPolicy(1 /* ErrorPolicy.SkipOnError */);
|
|
99
|
-
this.setStatus(Action_1.Status.Error);
|
|
100
|
-
case 1 /* ErrorPolicy.SkipOnError */:
|
|
101
|
-
this.setStatus(Action_1.Status.Skipped);
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
isEmpty() {
|
|
108
|
-
return this.actions && this.actions.length === 0;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.Action_Container = Action_Container;
|
|
112
|
-
//# sourceMappingURL=Action_Container.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_Container.js","sourceRoot":"","sources":["../../src/main/core/Action_Container.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,qCAIkB;AAElB,yDAG4B;AAE5B,MAAsB,gBACrB,SAAQ,eAAM;IAOd,YAAsB,IAAc,EAAE,GAAY;QACjD,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QANR,YAAO,GAAiB,IAAI,+BAAY,EAAE,CAAC;QAEpC,YAAO,GAAkB,EAAE,CAAC;QACrC,YAAO,GAAY,KAAK,CAAC;IAIjC,CAAC;IAED,WAAW;QACV,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,GAAG,CAAC,GAAG,KAAoB;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,QAAQ,CAAC,OAAgB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,IAA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,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;IAEe,OAAO;;YACtB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACnC,IAAI,IAAI,CAAC,MAAM,KAAK,eAAM,CAAC,OAAO;oBACjC,MAAM,CAAC,SAAS,CAAC,eAAM,CAAC,OAAO,CAAC,CAAC;gBAElC,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACrC,IAAI,MAAM,CAAC,MAAM,KAAK,eAAM,CAAC,KAAK;oBACjC,SAAS;gBAEV,8CAA8C;gBAC9C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;oBACvB;wBACC,SAAS;oBAEV;wBACC,IAAI,CAAC,cAAc,iCAAyB,CAAC;wBAC7C,IAAI,CAAC,SAAS,CAAC,eAAM,CAAC,KAAK,CAAC,CAAC;oBAE9B;wBACC,IAAI,CAAC,SAAS,CAAC,eAAM,CAAC,OAAO,CAAC,CAAC;wBAC/B,MAAM;gBACR,CAAC;YACF,CAAC;QACF,CAAC;KAAA;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;IAClD,CAAC;CACD;AAjGD,4CAiGC"}
|
package/core/Action_Custom.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_Custom = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_1 = require("./Action");
|
|
34
|
-
class Action_Custom extends Action_1.Action {
|
|
35
|
-
constructor(action) {
|
|
36
|
-
super(Action_Custom);
|
|
37
|
-
this.action = action;
|
|
38
|
-
}
|
|
39
|
-
execute(param) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return yield this.action(this, param);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Action_Custom = Action_Custom;
|
|
46
|
-
//# sourceMappingURL=Action_Custom.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_Custom.js","sourceRoot":"","sources":["../../src/main/core/Action_Custom.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,qCAAgC;AAEhC,MAAa,aACZ,SAAQ,eAA+B;IAGvC,YAAsB,MAA0E;QAC/F,KAAK,CAAC,aAAa,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAEe,OAAO,CAAC,KAAiB;;YACxC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvC,CAAC;KAAA;CACD;AAZD,sCAYC"}
|
package/core/Action_Http.js
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_Http = exports.HttpMethod = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
34
|
-
const Action_1 = require("./Action");
|
|
35
|
-
const fetch = require("node-fetch");
|
|
36
|
-
var HttpMethod;
|
|
37
|
-
(function (HttpMethod) {
|
|
38
|
-
HttpMethod["ALL"] = "all";
|
|
39
|
-
HttpMethod["POST"] = "post";
|
|
40
|
-
HttpMethod["GET"] = "get";
|
|
41
|
-
HttpMethod["PATCH"] = "patch";
|
|
42
|
-
HttpMethod["DELETE"] = "delete";
|
|
43
|
-
HttpMethod["PUT"] = "put";
|
|
44
|
-
HttpMethod["OPTIONS"] = "options";
|
|
45
|
-
HttpMethod["HEAD"] = "head";
|
|
46
|
-
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
|
|
47
|
-
class Action_Http extends Action_1.Action {
|
|
48
|
-
constructor(method) {
|
|
49
|
-
super(Action_Http);
|
|
50
|
-
this.headers = {};
|
|
51
|
-
this.params = {};
|
|
52
|
-
this.responseStatus = 200;
|
|
53
|
-
this.method = method;
|
|
54
|
-
}
|
|
55
|
-
setUrl(url) {
|
|
56
|
-
this.url = url;
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
;
|
|
60
|
-
setBody(body) {
|
|
61
|
-
this.body = body;
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
;
|
|
65
|
-
setParams(params) {
|
|
66
|
-
this.params = params;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
;
|
|
70
|
-
addHeader(key, value) {
|
|
71
|
-
this.headers[key] = value;
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
;
|
|
75
|
-
setResponseStatus(status) {
|
|
76
|
-
this.responseStatus = status;
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
setResponseProcessor(validator) {
|
|
80
|
-
this.responseProcessor = validator;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
resolveBody() {
|
|
84
|
-
if (typeof this.body === "function")
|
|
85
|
-
this.body = this.body(this);
|
|
86
|
-
if (typeof this.body === "string")
|
|
87
|
-
return this.body;
|
|
88
|
-
this.addHeader("Accept", 'application/json');
|
|
89
|
-
this.addHeader("Content-Type", 'application/json');
|
|
90
|
-
return JSON.stringify(this.body, null, 2);
|
|
91
|
-
}
|
|
92
|
-
resolveUrl() {
|
|
93
|
-
if (typeof this.url === "function")
|
|
94
|
-
this.url = this.url(this);
|
|
95
|
-
return this.url + `${this.toUrlParams()}`;
|
|
96
|
-
}
|
|
97
|
-
toUrlParams() {
|
|
98
|
-
if (!this.params)
|
|
99
|
-
return "";
|
|
100
|
-
if (typeof this.params === "function")
|
|
101
|
-
this.params = this.params();
|
|
102
|
-
if (Object.keys(this.params).length === 0)
|
|
103
|
-
return "";
|
|
104
|
-
return `?${Object.keys(this.params).map((key) => {
|
|
105
|
-
return `${key}=${this.params[key]}`;
|
|
106
|
-
}).join("&")}`;
|
|
107
|
-
}
|
|
108
|
-
execute() {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const url = this.resolveUrl();
|
|
111
|
-
const body = this.resolveBody();
|
|
112
|
-
const headers = {};
|
|
113
|
-
for (const key of Object.keys(this.headers)) {
|
|
114
|
-
const value = this.headers[key];
|
|
115
|
-
if (typeof value !== "string") {
|
|
116
|
-
headers[key] = value(this);
|
|
117
|
-
}
|
|
118
|
-
else
|
|
119
|
-
headers[key] = value;
|
|
120
|
-
}
|
|
121
|
-
const requestBody = {
|
|
122
|
-
headers: JSON.parse(JSON.stringify(headers)),
|
|
123
|
-
body: body,
|
|
124
|
-
method: this.method
|
|
125
|
-
};
|
|
126
|
-
this.logInfo(`----- Method: ${requestBody.method}`);
|
|
127
|
-
this.logInfo(`-------- Uri: ${url}`);
|
|
128
|
-
if (Object.keys(headers).length > 0) {
|
|
129
|
-
this.logVerbose("-------- Headers --------");
|
|
130
|
-
for (const key of Object.keys(headers)) {
|
|
131
|
-
this.logVerbose(` ${key}: ${headers[key]}`);
|
|
132
|
-
}
|
|
133
|
-
this.logVerbose("-------------------------");
|
|
134
|
-
}
|
|
135
|
-
if (requestBody.body) {
|
|
136
|
-
this.logVerbose("--------- Request Body ----------");
|
|
137
|
-
this.logVerbose(body);
|
|
138
|
-
this.logVerbose("-------------------------");
|
|
139
|
-
}
|
|
140
|
-
return yield this.executeHttpRequest(requestBody);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
;
|
|
144
|
-
resolveResponseBody(response) {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
const contentType = response.headers.get("Content-Type");
|
|
147
|
-
if (!contentType)
|
|
148
|
-
return;
|
|
149
|
-
// @ts-ignore
|
|
150
|
-
let match;
|
|
151
|
-
switch (contentType) {
|
|
152
|
-
case (match = (0, ts_common_1.regexpCase)(contentType, ".*application/json.*")).input:
|
|
153
|
-
return yield response.json();
|
|
154
|
-
case (match = (0, ts_common_1.regexpCase)(contentType, ".*application/x-www-form-urlencoded.*")).input:
|
|
155
|
-
return decodeURI((yield response.text()));
|
|
156
|
-
case (match = (0, ts_common_1.regexpCase)(contentType, "^text\\/.*")).input:
|
|
157
|
-
return yield response.text();
|
|
158
|
-
default:
|
|
159
|
-
if (Action_Http.global_resolveResponseBody)
|
|
160
|
-
return Action_Http.global_resolveResponseBody(this, response);
|
|
161
|
-
}
|
|
162
|
-
throw new ts_common_1.ImplementationMissingException(`unhandled response with content-type: ${contentType}`);
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
executeHttpRequest(requestBody) {
|
|
166
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
const response = yield fetch.default(this.resolveUrl(), requestBody);
|
|
168
|
-
const status = response.status;
|
|
169
|
-
let _responseBody = "";
|
|
170
|
-
const expectedStatus = this.responseStatus;
|
|
171
|
-
if (status !== expectedStatus || status >= 500 && status < 600) {
|
|
172
|
-
try {
|
|
173
|
-
_responseBody = yield response.text();
|
|
174
|
-
}
|
|
175
|
-
catch (ignore) {
|
|
176
|
-
}
|
|
177
|
-
this.logError(`Got Response code: ${status}`);
|
|
178
|
-
this.logError(`Got Response body: ${_responseBody}`);
|
|
179
|
-
throw new ts_common_1.Exception(`wrong status code from server. Expected: ${expectedStatus} received: ${status}`);
|
|
180
|
-
}
|
|
181
|
-
// we don't want to undefine what was already defined just because we failed...
|
|
182
|
-
if (status !== 200 && this.writeKey)
|
|
183
|
-
this.get(this.writeKey);
|
|
184
|
-
let responseBody = yield this.resolveResponseBody(response);
|
|
185
|
-
if (this.responseProcessor)
|
|
186
|
-
responseBody = this.responseProcessor(responseBody);
|
|
187
|
-
if (responseBody) {
|
|
188
|
-
this.logVerbose("--------- Response ----------");
|
|
189
|
-
this.logVerbose(typeof responseBody === "object" ? JSON.stringify(responseBody, null, 2) : responseBody);
|
|
190
|
-
this.logVerbose("-------------------------");
|
|
191
|
-
}
|
|
192
|
-
return responseBody;
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.Action_Http = Action_Http;
|
|
197
|
-
//# sourceMappingURL=Action_Http.js.map
|
package/core/Action_Http.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_Http.js","sourceRoot":"","sources":["../../src/main/core/Action_Http.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,4DAIsC;AACtC,qCAAgC;AAChC,oCAAmC;AAEnC,IAAY,UASX;AATD,WAAY,UAAU;IACrB,yBAAe,CAAA;IACf,2BAAgB,CAAA;IAChB,yBAAe,CAAA;IACf,6BAAiB,CAAA;IACjB,+BAAkB,CAAA;IAClB,yBAAe,CAAA;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scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_Log = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_1 = require("./Action");
|
|
34
|
-
class Action_Log extends Action_1.Action {
|
|
35
|
-
constructor(logMessage, level) {
|
|
36
|
-
super(Action_Log);
|
|
37
|
-
this.setLabel();
|
|
38
|
-
this.logMessage = logMessage;
|
|
39
|
-
this.level = level;
|
|
40
|
-
}
|
|
41
|
-
execute() {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
this.log(this.level, false, [this.logMessage]);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.Action_Log = Action_Log;
|
|
48
|
-
//# sourceMappingURL=Action_Log.js.map
|
package/core/Action_Log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_Log.js","sourceRoot":"","sources":["../../src/main/core/Action_Log.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,qCAAgC;AAIhC,MAAa,UACZ,SAAQ,eAAM;IAId,YAAsB,UAAkB,EAAE,KAAe;QACxD,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAEe,OAAO;;YACtB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAChD,CAAC;KAAA;CACD;AAfD,gCAeC"}
|
package/core/Action_Sleep.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_Sleep = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_1 = require("./Action");
|
|
34
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
35
|
-
class Action_Sleep extends Action_1.Action {
|
|
36
|
-
constructor(sleepMs) {
|
|
37
|
-
super(Action_Sleep);
|
|
38
|
-
this.setLabel(`Sleeping for ${sleepMs} ms`);
|
|
39
|
-
this.sleepMs = sleepMs;
|
|
40
|
-
}
|
|
41
|
-
execute() {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return (0, ts_common_1.timeout)(this.sleepMs);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.Action_Sleep = Action_Sleep;
|
|
48
|
-
//# sourceMappingURL=Action_Sleep.js.map
|
package/core/Action_Sleep.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_Sleep.js","sourceRoot":"","sources":["../../src/main/core/Action_Sleep.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,qCAAgC;AAChC,4DAAqD;AAGrD,MAAa,YACZ,SAAQ,eAAM;IAGd,YAAsB,OAAe;QACpC,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,OAAO,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAEe,OAAO;;YACtB,OAAO,IAAA,mBAAO,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;KAAA;CACD;AAbD,oCAaC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Action_ThrowException = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_1 = require("./Action");
|
|
34
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
35
|
-
class Action_ThrowException extends Action_1.Action {
|
|
36
|
-
constructor(message, tag) {
|
|
37
|
-
super(Action_ThrowException, tag);
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
execute() {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
throw new ts_common_1.Exception(this.message);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.Action_ThrowException = Action_ThrowException;
|
|
47
|
-
//# sourceMappingURL=Action_ThrowException.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action_ThrowException.js","sourceRoot":"","sources":["../../src/main/core/Action_ThrowException.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,qCAAgC;AAChC,4DAAuD;AAGvD,MAAa,qBACZ,SAAQ,eAAM;IAGd,YAAsB,OAAe,EAAE,GAAY;QAClD,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAEe,OAAO;;YACtB,MAAM,IAAI,qBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;KAAA;CACD;AAZD,sDAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerContext.js","sourceRoot":"","sources":["../../src/main/core/ContainerContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH;;GAEG;AAEH,MAAa,UAAU;IAItB,YAAY,GAAW,EAAE,YAAgB;QACxC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,CAAC;CACD;AARD,gCAQC;AAED,MAAa,YAAY;IAAzB;QAES,QAAG,GAAqB,IAAI,GAAG,EAAe,CAAC;IAiBxD,CAAC;IAfA,MAAM,CAAC,GAAoB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,GAAG,CAAY,GAA0B;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAc,CAAC;IAC3C,CAAC;IAED,GAAG,CAAY,GAA0B,EAAE,KAAgB;QAC1D,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAEA,KAAK;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACD;AAnBD,oCAmBC"}
|
package/core/Reporter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Reporter.js","sourceRoot":"","sources":["../../src/main/core/Reporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,qCAGkB;AAElB,4DAYsC;AAEtC,MAAM,aAAa;IAAnB;QACC,YAAO,GAAW,CAAC,CAAC;QACpB,YAAO,GAAW,CAAC,CAAC;QACpB,YAAO,GAAW,CAAC,CAAC;QACpB,UAAK,GAAW,CAAC,CAAC;IACnB,CAAC;CAAA;AAED,MAAa,QACZ,SAAQ,kBAAM;IASd;QACC,KAAK,CAAC,UAAU,CAAC,CAAC;QAR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AAC,CAAC;YAEjD,OAAO,IAAI,aAAa,IAAI,mBAAO,IAAI,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1E,CAAC,CAAA;QAfA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAeS,UAAU,CAAC,KAAe,EAAE,IAAa,EAAE,MAAc,EAAE,KAAiB;QACrF,MAAM,KAAK,GAAG,8BAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACvD,MAAM,eAAe,GAAG,IAAA,6CAAiC,EAAC,KAAK,CAAC,CAAC;QACjE,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,mCAAuB,EAAC,KAAK,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,mBAAO,CAAC,CAAC,CAAA;IACnG,CAAC;IAED,kBAAkB;QACjB,IAAI,CAAC,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC;IACzC,CAAC;IAED,gBAAgB;QACf,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7F,OAAO;IACR,CAAC;;AAlCc,wBAAM,GAAW,IAAI,AAAf,CAAgB"}
|
package/core/Scenario.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Testelot is a typescript scenario composing framework
|
|
4
|
-
*
|
|
5
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Scenario = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* Created by IR on 3/18/17.
|
|
32
|
-
*/
|
|
33
|
-
const Action_Container_1 = require("./Action_Container");
|
|
34
|
-
class Scenario extends Action_Container_1.Action_Container {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(Scenario);
|
|
37
|
-
this.run = () => __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
yield this._execute();
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.Scenario = Scenario;
|
|
44
|
-
//# sourceMappingURL=Scenario.js.map
|
package/core/Scenario.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scenario.js","sourceRoot":"","sources":["../../src/main/core/Scenario.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;AAEH;;GAEG;AACH,yDAAoD;AAEpD,MAAa,QACZ,SAAQ,mCAAgB;IAExB;QACC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAGV,QAAG,GAAG,GAAS,EAAE;YACvB,aAAa;YACb,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvB,CAAC,CAAA,CAAC;IALF,CAAC;CAMD;AAXD,4BAWC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestException.js","sourceRoot":"","sources":["../../src/main/core/TestException.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH;;GAEG;AACH,4DAA6D;AAG7D,MAAa,aACZ,SAAQ,2BAAe;IAEvB,YAAY,OAAe;QAC1B,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;CACD;AAND,sCAMC"}
|