testit-adapter-mocha 5.0.4 → 5.0.6
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 +3 -0
- package/lib/reporter.js +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -146,6 +146,7 @@ Description of metadata properties:
|
|
|
146
146
|
- `this.title` - autotest name specified in the autotest card. If not specified, the name from the displayName method is used
|
|
147
147
|
- `this.description` - autotest description specified in the autotest card
|
|
148
148
|
- `this.labels` - labels listed in the autotest card
|
|
149
|
+
- `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
|
|
149
150
|
- `this.tags` - tags listed in the autotest card
|
|
150
151
|
- `this.links` - links listed in the autotest card
|
|
151
152
|
- `this.nameSpace` - directory in the TMS system (default - directory's name of test)
|
|
@@ -168,6 +169,7 @@ Description of methods:
|
|
|
168
169
|
|
|
169
170
|
import assert from "assert";
|
|
170
171
|
import {Context, Link} from "testit-adapter-mocha";
|
|
172
|
+
import { TestLayers } from "testit-js-commons";
|
|
171
173
|
|
|
172
174
|
const links: Link[] = [
|
|
173
175
|
{ url: "https://test01.example", title: "Example01", description: "Example01 description", type: "Issue" },
|
|
@@ -188,6 +190,7 @@ it('All annotations and methods', function (this: Context) {
|
|
|
188
190
|
this.title = 'title';
|
|
189
191
|
this.description = 'description';
|
|
190
192
|
this.labels = ['label1', 'label2'];
|
|
193
|
+
this.layer = TestLayers.API;
|
|
191
194
|
this.links = links;
|
|
192
195
|
|
|
193
196
|
this.addMessage('This is a message');
|
package/lib/reporter.js
CHANGED
|
@@ -167,6 +167,7 @@ class TmsReporter extends Reporter {
|
|
|
167
167
|
ctx.description = undefined;
|
|
168
168
|
ctx.links = [];
|
|
169
169
|
ctx.labels = [];
|
|
170
|
+
ctx.layer = undefined;
|
|
170
171
|
ctx.tags = [];
|
|
171
172
|
ctx.classname = undefined;
|
|
172
173
|
ctx.workItemsIds = [];
|
|
@@ -197,6 +198,7 @@ class TmsReporter extends Reporter {
|
|
|
197
198
|
title: test.ctx?.title,
|
|
198
199
|
links: test.ctx?.links,
|
|
199
200
|
labels: test.ctx?.labels?.map((label) => ({ name: label })),
|
|
201
|
+
layer: test.ctx?.layer,
|
|
200
202
|
tags: test.ctx?.tags,
|
|
201
203
|
namespace: test.ctx?.namespace ?? this._getNameSpace(test.file),
|
|
202
204
|
classname: test.ctx?.classname ?? this._getClassName(test.file),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testit-adapter-mocha",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
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.6"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"lib"
|