@cucumber/html-formatter 11.0.2 → 13.0.0
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/.mocharc.json +2 -2
- package/Makefile +16 -2
- package/check.js +22 -0
- package/default.mk +19 -47
- package/dist/cucumber-react.css +291 -0
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +4 -19
- package/dist/package.json +22 -35
- package/dist/src/CucumberHtmlStream.d.ts +3 -2
- package/dist/src/CucumberHtmlStream.d.ts.map +1 -0
- package/dist/src/CucumberHtmlStream.js +46 -68
- package/dist/src/CucumberHtmlStream.js.map +1 -1
- package/dist/src/cli-main.d.ts +1 -0
- package/dist/src/cli-main.d.ts.map +1 -0
- package/dist/src/cli-main.js +10 -11
- package/dist/src/cli-main.js.map +1 -1
- package/dist/src/index.mustache.html +1 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +15 -37
- package/dist/src/main.js.map +1 -1
- package/dist/test/CucumberHtmlStreamTest.d.ts +1 -0
- package/dist/test/CucumberHtmlStreamTest.d.ts.map +1 -0
- package/dist/test/CucumberHtmlStreamTest.js +41 -122
- package/dist/test/CucumberHtmlStreamTest.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +4208 -0
- package/logo.svg +7 -0
- package/package.json +22 -35
- package/src/CucumberHtmlStream.ts +8 -21
- package/src/cli-main.ts +7 -20
- package/src/index.mustache.html +1 -0
- package/src/main.tsx +1 -5
- package/test/CucumberHtmlStreamTest.ts +9 -21
- package/test/dummy.css +0 -0
- package/test/dummy.js +0 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +1 -24
- package/webpack.config.js +1 -17
- package/.eslintrc.json +0 -41
- package/.nycrc.json +0 -16
- package/.prettierrc +0 -5
|
@@ -8,137 +8,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __values = (this && this.__values) || function(o) {
|
|
39
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
-
if (m) return m.call(o);
|
|
41
|
-
if (o && typeof o.length === "number") return {
|
|
42
|
-
next: function () {
|
|
43
|
-
if (o && i >= o.length) o = void 0;
|
|
44
|
-
return { value: o && o[i++], done: !o };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
-
};
|
|
49
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
13
|
};
|
|
52
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
function renderAsHtml() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
'/../node_modules/@cucumber/react/dist/src/styles/cucumber-react.css', __dirname + '/../dist/main.js');
|
|
76
|
-
cucumberHtmlStream.pipe(sink);
|
|
77
|
-
try {
|
|
78
|
-
for (var envelopes_1 = __values(envelopes), envelopes_1_1 = envelopes_1.next(); !envelopes_1_1.done; envelopes_1_1 = envelopes_1.next()) {
|
|
79
|
-
var envelope = envelopes_1_1.value;
|
|
80
|
-
cucumberHtmlStream.write(envelope);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
84
|
-
finally {
|
|
85
|
-
try {
|
|
86
|
-
if (envelopes_1_1 && !envelopes_1_1.done && (_a = envelopes_1.return)) _a.call(envelopes_1);
|
|
87
|
-
}
|
|
88
|
-
finally { if (e_1) throw e_1.error; }
|
|
89
|
-
}
|
|
90
|
-
cucumberHtmlStream.end();
|
|
91
|
-
})];
|
|
15
|
+
const messages_1 = require("@cucumber/messages");
|
|
16
|
+
const CucumberHtmlStream_1 = __importDefault(require("../src/CucumberHtmlStream"));
|
|
17
|
+
const stream_1 = require("stream");
|
|
18
|
+
const assert_1 = __importDefault(require("assert"));
|
|
19
|
+
function renderAsHtml(...envelopes) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
let html = '';
|
|
23
|
+
const sink = new stream_1.Writable({
|
|
24
|
+
write(chunk, encoding, callback) {
|
|
25
|
+
html += chunk;
|
|
26
|
+
callback();
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
sink.on('finish', () => resolve(html));
|
|
30
|
+
const cucumberHtmlStream = new CucumberHtmlStream_1.default(`${__dirname}/dummy.css`, `${__dirname}/dummy.js`);
|
|
31
|
+
cucumberHtmlStream.on('error', reject);
|
|
32
|
+
cucumberHtmlStream.pipe(sink);
|
|
33
|
+
for (const envelope of envelopes) {
|
|
34
|
+
cucumberHtmlStream.write(envelope);
|
|
35
|
+
}
|
|
36
|
+
cucumberHtmlStream.end();
|
|
92
37
|
});
|
|
93
38
|
});
|
|
94
39
|
}
|
|
95
|
-
describe('CucumberHtmlStream',
|
|
96
|
-
it('writes zero messages to html',
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
assert_1.default(html.indexOf('window.CUCUMBER_MESSAGES = []') >= 0);
|
|
104
|
-
return [2 /*return*/];
|
|
105
|
-
}
|
|
40
|
+
describe('CucumberHtmlStream', () => {
|
|
41
|
+
it('writes zero messages to html', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
const html = yield renderAsHtml();
|
|
43
|
+
assert_1.default(html.indexOf('window.CUCUMBER_MESSAGES = []') >= 0);
|
|
44
|
+
}));
|
|
45
|
+
it('writes one message to html', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
const e1 = messages_1.messages.Envelope.create({
|
|
47
|
+
testRunStarted: messages_1.messages.TestRunStarted.create({}),
|
|
106
48
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
e1 = messages_1.messages.Envelope.create({
|
|
114
|
-
testRunStarted: messages_1.messages.TestRunStarted.create({}),
|
|
115
|
-
});
|
|
116
|
-
return [4 /*yield*/, renderAsHtml(e1)];
|
|
117
|
-
case 1:
|
|
118
|
-
html = _a.sent();
|
|
119
|
-
assert_1.default(html.indexOf("window.CUCUMBER_MESSAGES = [" + JSON.stringify(e1.toJSON()) + "]") >= 0);
|
|
120
|
-
return [2 /*return*/];
|
|
121
|
-
}
|
|
49
|
+
const html = yield renderAsHtml(e1);
|
|
50
|
+
assert_1.default(html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1.toJSON())}]`) >= 0);
|
|
51
|
+
}));
|
|
52
|
+
it('writes two messages to html', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
const e1 = messages_1.messages.Envelope.create({
|
|
54
|
+
testRunStarted: messages_1.messages.TestRunStarted.create({}),
|
|
122
55
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var e1, e2, html;
|
|
126
|
-
return __generator(this, function (_a) {
|
|
127
|
-
switch (_a.label) {
|
|
128
|
-
case 0:
|
|
129
|
-
e1 = messages_1.messages.Envelope.create({
|
|
130
|
-
testRunStarted: messages_1.messages.TestRunStarted.create({}),
|
|
131
|
-
});
|
|
132
|
-
e2 = messages_1.messages.Envelope.create({
|
|
133
|
-
testRunFinished: messages_1.messages.TestRunFinished.create({}),
|
|
134
|
-
});
|
|
135
|
-
return [4 /*yield*/, renderAsHtml(e1, e2)];
|
|
136
|
-
case 1:
|
|
137
|
-
html = _a.sent();
|
|
138
|
-
assert_1.default(html.indexOf("window.CUCUMBER_MESSAGES = [" + JSON.stringify(e1.toJSON()) + "," + JSON.stringify(e2.toJSON()) + "]") >= 0);
|
|
139
|
-
return [2 /*return*/];
|
|
140
|
-
}
|
|
56
|
+
const e2 = messages_1.messages.Envelope.create({
|
|
57
|
+
testRunFinished: messages_1.messages.TestRunFinished.create({}),
|
|
141
58
|
});
|
|
142
|
-
|
|
59
|
+
const html = yield renderAsHtml(e1, e2);
|
|
60
|
+
assert_1.default(html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1.toJSON())},${JSON.stringify(e2.toJSON())}]`) >= 0);
|
|
61
|
+
}));
|
|
143
62
|
});
|
|
144
63
|
//# sourceMappingURL=CucumberHtmlStreamTest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CucumberHtmlStreamTest.js","sourceRoot":"","sources":["../../test/CucumberHtmlStreamTest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CucumberHtmlStreamTest.js","sourceRoot":"","sources":["../../test/CucumberHtmlStreamTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iDAA6C;AAC7C,mFAA0D;AAC1D,mCAAiC;AACjC,oDAA2B;AAE3B,SAAe,YAAY,CAAC,GAAG,SAA+B;;QAC5D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,MAAM,IAAI,GAAa,IAAI,iBAAQ,CAAC;gBAClC,KAAK,CAAC,KAAU,EAAE,QAAgB,EAAE,QAAwC;oBAC1E,IAAI,IAAI,KAAK,CAAA;oBACb,QAAQ,EAAE,CAAA;gBACZ,CAAC;aACF,CAAC,CAAA;YACF,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;YACtC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