squally-reporter 0.1.0 → 0.1.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/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,6 +102,14 @@ function detectEventType() {
|
|
|
102
102
|
return process.env.CI_PIPELINE_SOURCE;
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
|
+
// path.relative() joins with path.sep, which is "\" on Windows and "/" on
|
|
106
|
+
// POSIX. Since testName+filePath is Squally's test identity, an
|
|
107
|
+
// un-normalized filePath would make the same test look like two different
|
|
108
|
+
// tests depending on which OS the run happened on - always normalize to
|
|
109
|
+
// forward slashes regardless of host platform.
|
|
110
|
+
function toPosixPath(p) {
|
|
111
|
+
return p.split(node_path_1.default.sep).join("/");
|
|
112
|
+
}
|
|
105
113
|
class SquallyReporter {
|
|
106
114
|
constructor(options = {}) {
|
|
107
115
|
this.startedAt = new Date();
|
|
@@ -122,7 +130,7 @@ class SquallyReporter {
|
|
|
122
130
|
const error = result.errors[0];
|
|
123
131
|
this.results.push({
|
|
124
132
|
testName: test.titlePath().slice(1).join(" > "),
|
|
125
|
-
filePath: node_path_1.default.relative(process.cwd(), test.location.file),
|
|
133
|
+
filePath: toPosixPath(node_path_1.default.relative(process.cwd(), test.location.file)),
|
|
126
134
|
status: mapStatus(result.status),
|
|
127
135
|
durationMs: result.duration,
|
|
128
136
|
retryCount: result.retry,
|