testit-adapter-mocha 5.0.7 → 5.0.8-TMS-5.8
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/README.md +1 -5
- package/lib/reporter.d.ts +0 -1
- package/lib/reporter.js +1 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -140,14 +140,12 @@ Methods and properties can be used to specify information about autotest.
|
|
|
140
140
|
### Properties
|
|
141
141
|
|
|
142
142
|
Description of metadata properties:
|
|
143
|
-
- `this.
|
|
144
|
-
- `this.workItemsIds` - deprecated, use `this.workItemId` instead
|
|
143
|
+
- `this.workItemsIds` - a method that links autotests with manual tests. Receives the array of manual tests' IDs
|
|
145
144
|
- `this.displayName` - internal autotest name (used in Test IT)
|
|
146
145
|
- `this.externalId` - unique internal autotest ID (used in Test IT)
|
|
147
146
|
- `this.title` - autotest name specified in the autotest card. If not specified, the name from the displayName method is used
|
|
148
147
|
- `this.description` - autotest description specified in the autotest card
|
|
149
148
|
- `this.labels` - labels listed in the autotest card
|
|
150
|
-
- `this.layer` - test pyramid layer in the autotest card (source **Run**). Use `TestLayers` from `testit-js-commons` for recommended values (`E2E`, `UI`, `API`, `Contract`, `Integration`, `Component`, `Unit`), or any custom string
|
|
151
149
|
- `this.tags` - tags listed in the autotest card
|
|
152
150
|
- `this.links` - links listed in the autotest card
|
|
153
151
|
- `this.nameSpace` - directory in the TMS system (default - directory's name of test)
|
|
@@ -170,7 +168,6 @@ Description of methods:
|
|
|
170
168
|
|
|
171
169
|
import assert from "assert";
|
|
172
170
|
import {Context, Link} from "testit-adapter-mocha";
|
|
173
|
-
import { TestLayers } from "testit-js-commons";
|
|
174
171
|
|
|
175
172
|
const links: Link[] = [
|
|
176
173
|
{ url: "https://test01.example", title: "Example01", description: "Example01 description", type: "Issue" },
|
|
@@ -191,7 +188,6 @@ it('All annotations and methods', function (this: Context) {
|
|
|
191
188
|
this.title = 'title';
|
|
192
189
|
this.description = 'description';
|
|
193
190
|
this.labels = ['label1', 'label2'];
|
|
194
|
-
this.layer = TestLayers.API;
|
|
195
191
|
this.links = links;
|
|
196
192
|
|
|
197
193
|
this.addMessage('This is a message');
|
package/lib/reporter.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ export declare class TmsReporter extends Reporter {
|
|
|
31
31
|
addSteps: (title: string, stepConstructor?: (step: ITestStep) => void) => void;
|
|
32
32
|
private _getNameSpace;
|
|
33
33
|
private _getClassName;
|
|
34
|
-
private resolveWorkItemIds;
|
|
35
34
|
private _getOutcome;
|
|
36
35
|
private _getDuration;
|
|
37
36
|
}
|
package/lib/reporter.js
CHANGED
|
@@ -167,10 +167,8 @@ class TmsReporter extends Reporter {
|
|
|
167
167
|
ctx.description = undefined;
|
|
168
168
|
ctx.links = [];
|
|
169
169
|
ctx.labels = [];
|
|
170
|
-
ctx.layer = undefined;
|
|
171
170
|
ctx.tags = [];
|
|
172
171
|
ctx.classname = undefined;
|
|
173
|
-
ctx.workItemId = undefined;
|
|
174
172
|
ctx.workItemsIds = [];
|
|
175
173
|
ctx.parameters = {};
|
|
176
174
|
ctx.properties = {};
|
|
@@ -199,14 +197,13 @@ class TmsReporter extends Reporter {
|
|
|
199
197
|
title: test.ctx?.title,
|
|
200
198
|
links: test.ctx?.links,
|
|
201
199
|
labels: test.ctx?.labels?.map((label) => ({ name: label })),
|
|
202
|
-
layer: test.ctx?.layer,
|
|
203
200
|
tags: test.ctx?.tags,
|
|
204
201
|
namespace: test.ctx?.namespace ?? this._getNameSpace(test.file),
|
|
205
202
|
classname: test.ctx?.classname ?? this._getClassName(test.file),
|
|
206
203
|
steps: this.currentTest.stepResults,
|
|
207
204
|
setup,
|
|
208
205
|
teardown,
|
|
209
|
-
workItemIds:
|
|
206
|
+
workItemIds: test.ctx?.workItemsIds,
|
|
210
207
|
externalKey: test.title,
|
|
211
208
|
};
|
|
212
209
|
const outcome = this._getOutcome(test.state);
|
|
@@ -259,15 +256,6 @@ class TmsReporter extends Reporter {
|
|
|
259
256
|
_getClassName(path) {
|
|
260
257
|
return path && testit_js_commons_1.Utils.getFileName(path);
|
|
261
258
|
}
|
|
262
|
-
resolveWorkItemIds(ctx) {
|
|
263
|
-
if (ctx?.workItemsIds?.length) {
|
|
264
|
-
testit_js_commons_2.logger.warn("workItemsIds is deprecated. Use workItemId with a single globalId instead.");
|
|
265
|
-
}
|
|
266
|
-
if (ctx?.workItemId) {
|
|
267
|
-
return [ctx.workItemId];
|
|
268
|
-
}
|
|
269
|
-
return ctx?.workItemsIds;
|
|
270
|
-
}
|
|
271
259
|
_getOutcome(state) {
|
|
272
260
|
switch (state) {
|
|
273
261
|
case StateConstants.STATE_FAILED:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testit-adapter-mocha",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8-TMS-5.8",
|
|
4
4
|
"description": "Mocha adapter for Test IT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/types.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"mocha": "^10.2.0",
|
|
33
33
|
"deasync-promise": "^1.0.1",
|
|
34
|
-
"testit-js-commons": "5.0.
|
|
34
|
+
"testit-js-commons": "5.0.8-TMS-5.8"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"lib"
|