forked from SAP-archive/karma-ui5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
67 lines (58 loc) · 1.33 KB
/
Copy pathkarma.conf.js
File metadata and controls
67 lines (58 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const customCucumberReporter = require("./karma-reporter/index");
const customKarmaUI5 = require("../../../lib/index");
module.exports = function(config) {
"use strict";
require("../karma-base.conf")(config);
config.set({
plugins: [
"karma-chrome-launcher",
"karma-coverage",
customKarmaUI5,
customCucumberReporter
],
ui5: {
type: "application",
mode: "html",
testpage: "webapp/test/GherkinTestRunner.html",
url: "http://localhost:" + config.localUI5ServerPort,
logAssertions: true
},
frameworks: ["ui5"],
preprocessors: {
"{webapp,webapp/!(test)}/*.js": ["coverage"]
},
cucumberReporter: {
out: "application-log-assersion/cucumber.json",
prefix: ""
},
coverageReporter: {
includeAllSources: true,
reporters: [
{
type: "json",
dir: "coverage",
subdir: "json"
}
],
check: {
each: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
}
},
autoWatch: false,
singleRun: true,
reporters: ["progress", "coverage", "cucumber"]
});
};
module.exports.assertions = function({expect, log}) {
const features = require("./cucumber.json");
const scenarios = features[0].elements;
const steps = scenarios[0].steps;
expect(features).toHaveLength(1);
expect(scenarios).toHaveLength(12);
expect(steps).toHaveLength(2);
};