tape-six 1.3.0 → 1.3.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/README.md +1 -0
- package/package.json +1 -1
- package/src/JSONLReporter.js +11 -2
package/README.md
CHANGED
|
@@ -236,6 +236,7 @@ See [set-up tests](https://github.com/uhop/tape-six/wiki/Set-up-tests) for detai
|
|
|
236
236
|
|
|
237
237
|
The most recent releases:
|
|
238
238
|
|
|
239
|
+
- 1.3.1 _Bugfix for web browser using JSONL reporter._
|
|
239
240
|
- 1.3.0 _Bugfixes, updated dependencies, new feature: proxied console calls._
|
|
240
241
|
- 1.2.0 _Updated dependencies + added an optional prefix for JSON lines._
|
|
241
242
|
- 1.1.2 _Updated dependencies._
|
package/package.json
CHANGED
package/src/JSONLReporter.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
const getEnv = () => {
|
|
2
|
+
if (typeof Deno == 'object' && Deno?.version) {
|
|
3
|
+
return Deno.env;
|
|
4
|
+
} else if (typeof Bun == 'object' && Bun?.version) {
|
|
5
|
+
return Bun.env;
|
|
6
|
+
} else if (typeof process == 'object' && process?.versions?.node) {
|
|
7
|
+
return process.env;
|
|
8
|
+
}
|
|
9
|
+
return {};
|
|
10
|
+
};
|
|
2
11
|
|
|
3
12
|
export class JSONLReporter {
|
|
4
13
|
constructor({renumberAsserts = false, prefix} = {}) {
|
|
5
14
|
this.renumberAsserts = renumberAsserts;
|
|
6
15
|
this.assertCounter = 0;
|
|
7
16
|
|
|
8
|
-
const env = getEnv(
|
|
17
|
+
const env = getEnv();
|
|
9
18
|
prefix ||= env.TAPE6_JSONL_PREFIX;
|
|
10
19
|
this.prefix = prefix ? '\n' + prefix : '';
|
|
11
20
|
}
|