tape-six 0.12.3 → 1.0.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 CHANGED
@@ -3,35 +3,241 @@
3
3
  [npm-img]: https://img.shields.io/npm/v/tape-six.svg
4
4
  [npm-url]: https://npmjs.org/package/tape-six
5
5
 
6
- tape-six is a [TAP](https://en.wikipedia.org/wiki/Test_Anything_Protocol)-based library for unit tests. It is written in the modern JavaScript for the modern JavaScript and works in [node](https://nodejs.org/), [deno](https://deno.land/), [bun](https://bun.sh/) and browsers.
6
+ tape-six is a [TAP](https://en.wikipedia.org/wiki/Test_Anything_Protocol)-based library for unit tests.
7
+ It is written in the modern JavaScript for the modern JavaScript and works in [Node](https://nodejs.org/),
8
+ [Deno](https://deno.land/), [Bun](https://bun.sh/) and browsers.
7
9
 
8
- Why `tape-six`? It was supposed to be named `tape6` but `npm` does not allow names "similar" to existing packages. Instead of eliminating name-squatting they force to use unintuitive and unmemorable names. That's why all internal names, environment variables, and public names still use `tape6`.
10
+ Why `tape-six`? It was supposed to be named `tape6` but `npm` does not allow names "similar"
11
+ to existing packages. Instead of eliminating name-squatting they force to use unintuitive and
12
+ unmemorable names. That's why all internal names, environment variables, and public names still use `tape6`.
9
13
 
10
14
  ## Rationale
11
15
 
12
- Why another library? Working on projects written in modern JS (with modules) I found several problems with existing unit test libraries:
16
+ Why another library? Working on projects written in modern JS (with modules) I found several problems
17
+ with existing unit test libraries:
13
18
 
14
- * In my opinion unit test files should be directly executable with `node`, `deno`, browsers (with a trivial HTML file to load a test file) without a need for a special test runner utility, which wraps and massages my beautiful code.
19
+ * In my opinion unit test files should be directly executable with `node`, `deno`, `bun`, browsers
20
+ (with a trivial HTML file to load a test file) without a need for a special test runner utility,
21
+ which wraps and changes my beautiful code.
15
22
  * Debugging my tests should be trivial. It should not be different from debugging any regular file.
16
23
  * The test harness should not obfuscate code nor include hundreds of other packages.
17
24
  * I want to debug my code, not dependencies I've never heard about.
18
25
  * I want to see where a problem happens, not some guts of a test harness.
19
26
  * Tests should work with ES modules natively.
20
- * What if I want to debug some CommonJS code with Node? Fret not! Modules can import CommonJS files directly. But not the other way around. And it helps to test how module users can use your beautiful CommonJS package.
27
+ * What if I want to debug some CommonJS code with Node? Fret not! Modules can import CommonJS files directly.
28
+ But not the other way around (yet). And it helps to test how module users can use your beautiful
29
+ CommonJS package.
21
30
  * The [DX](https://en.wikipedia.org/wiki/User_experience#Developer_experience) in browsers are usually abysmal.
22
31
  * Both console-based debugging and a UI to navigate results should be properly supported.
23
32
 
24
33
  ## Docs
25
34
 
26
35
  The documentation can be found in the [wiki](https://github.com/uhop/tape-six/wiki).
36
+ See how it can be used in [tests/](https://github.com/uhop/tape-six/tree/master/tests).
27
37
 
28
- The documentation is mostly TBD but you can inspect `tests/` to see how it is used.
29
- If you are familiar with other TAP-based libraries you'll feel right at home.
38
+ The whole API is based on two objects: `test` and `Tester`.
39
+
40
+ ### `test`
41
+
42
+ `test` is the entry point to the test suite:
43
+
44
+ ```js
45
+ import test from 'tape-six';
46
+ ```
47
+
48
+ This function registers a test suite. Available options:
49
+
50
+ * `async test(name, options, testFn)` — registers a test suite to be executed asynchronously.
51
+ The returned promise is resolved when the test suite is finished.
52
+ * In most cases no need to wait for the returned promise.
53
+ * The test function has the following signature: `testFn(tester)`
54
+ * `test.skip(name, options, testFn)` — registers a test suite to be skipped.
55
+ * It is used to mark a test suite to be skipped. It will not be executed.
56
+ * `test.todo(name, options, testFn)` — registers a test suite that is marked as work in progress.
57
+ * Tests in this suite will be executed, errors will be reported but not counted as failures.
58
+ * It is used to mark tests for incomplete features under development.
59
+ * `test.asPromise(name, options, testPromiseFn)` — registers a test suite to be executed asynchronously
60
+ using the callback-style API to notify that the test suite is finished.
61
+ * The test function has a different signature: `testPromiseFn(tester, resolve, reject)`.
62
+
63
+ The arguments mentioned above are:
64
+
65
+ * `name` — the optional name of the test suite. If not provided, it will be set to the name of the test function or `'(anonymous)'`.
66
+ * `options` — the optional options object. Available options:
67
+ * `skip` — if `true`, the test suite will be skipped.
68
+ * `todo` — if `true`, the test suite will be marked as work in progress.
69
+ * `name` — the optional name of the test suite. If not provided, it will be set to the name of the test function or `'(anonymous)'`.
70
+ * Can be overridden by the `name` argument.
71
+ * `testFn` — the optional test function to be executed.
72
+ * Can be overridden by the `testFn` argument.
73
+ * `timeout` — the optional timeout in milliseconds. It is used for asynchronous tests.
74
+ * If the timeout is exceeded, the test suite will be marked as failed.
75
+ * **Important:** JavaScript does not provide a generic way to cancel asynchronous operations.
76
+ When the timeout is exceeded, `tape6` will stop waiting for the test to finish,
77
+ but it will continue running in the background.
78
+ * The default: no timeout.
79
+ * `testFn` — the test function to be executed. It will be called with the `tester` object.
80
+ The result will be ignored.
81
+ * This function can be an asynchronous one or return a promise.
82
+ * `testPromiseFn` — the test function to be executed. It will be called with the `tester` object
83
+ and two callbacks: `resolve` and `reject` modeled on the [Promise API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise).
84
+
85
+ Given all that `test` and its helpers can be called like this:
86
+
87
+ ```js
88
+ test(name, options, testFn);
89
+ test(name, testFn);
90
+ test(testFn);
91
+ test(name, options);
92
+ test(options, testFn);
93
+ test(options);
94
+
95
+ // examples:
96
+ test('foo', t => {
97
+ t.pass();
98
+ });
99
+ test('bar', async t => {
100
+ t.fail();
101
+ });
102
+ test(function baz(t) {
103
+ t.ok(1 < 2);
104
+ });
105
+ test({
106
+ name: 'qux',
107
+ todo: true,
108
+ testFn: t => {
109
+ t.ok(1 < 2);
110
+ }
111
+ });
112
+ ```
113
+
114
+ ### `Tester`
115
+
116
+ `Tester` helps to do asserts and provides an interface between a test suite and the test harness.
117
+ The following methods are available (all `msg` arguments are optional):
118
+
119
+ * Asserts:
120
+ * `pass(msg)` &mdash; asserts that the test passed.
121
+ * `fail(msg)` &mdash; asserts that the test failed.
122
+ * `ok(val, msg)` &mdash; asserts that `val` is truthy.
123
+ * `true()` &mdash; an alias of `ok()`.
124
+ * `assert()` &mdash; an alias of `ok()`.
125
+ * `notOk(val, msg)` &mdash; asserts that `val` is falsy.
126
+ * `false()` &mdash; an alias of `notOk()`.
127
+ * `notok()` &mdash; an alias of `notOk()`.
128
+ * `error(err, msg)` &mdash; asserts that `err` is falsy.
129
+ * `ifError()` &mdash; an alias of `error()`.
130
+ * `ifErr()` &mdash; an alias of `error()`.
131
+ * `iferror()` &mdash; an alias of `error()`.
132
+ * `strictEqual(a, b, msg)` &mdash; asserts that `a` and `b` are strictly equal.
133
+ * Strict equality is defined as `a === b`.
134
+ * `is()` &mdash; an alias of `strictEqual()`.
135
+ * `equal()` &mdash; an alias of `strictEqual()`.
136
+ * `isEqual()` &mdash; an alias of `strictEqual()`.
137
+ * `equals()` &mdash; an alias of `strictEqual()`.
138
+ * `strictEquals()` &mdash; an alias of `strictEqual()`.
139
+ * `notStrictEqual(a, b, msg)` &mdash; asserts that `a` and `b` are not strictly equal.
140
+ * `not()` &mdash; an alias of `notStrictEqual()`.
141
+ * `notEqual()` &mdash; an alias of `notStrictEqual()`.
142
+ * `notEquals()` &mdash; an alias of `notStrictEqual()`.
143
+ * `notStrictEquals()` &mdash; an alias of `notStrictEqual()`.
144
+ * `doesNotEqual()` &mdash; an alias of `notStrictEqual()`.
145
+ * `isUnequal()` &mdash; an alias of `notStrictEqual()`.
146
+ * `looseEqual(a, b, msg)` &mdash; asserts that `a` and `b` are loosely equal.
147
+ * Loose equality is defined as `a == b`.
148
+ * `looseEquals()` &mdash; an alias of `looseEqual()`.
149
+ * `notLooseEqual(a, b, msg)` &mdash; asserts that `a` and `b` are not loosely equal.
150
+ * `notLooseEquals()` &mdash; an alias of `notLooseEqual()`.
151
+ * `deepEqual(a, b, msg)` &mdash; asserts that `a` and `b` are deeply equal.
152
+ * Individual components of `a` and `b` are compared recursively using the strict equality.
153
+ * See [deep6's equal()](https://github.com/uhop/deep6/wiki/equal()) for details.
154
+ * `same()` &mdash; an alias of `deepEqual()`.
155
+ * `deepEquals()` &mdash; an alias of `deepEqual()`.
156
+ * `isEquivalent()` &mdash; an alias of `deepEqual()`.
157
+ * `notDeepEqual(a, b, msg)` &mdash; asserts that `a` and `b` are not deeply equal.
158
+ * `notSame()` &mdash; an alias of `notDeepEqual()`.
159
+ * `notDeepEquals()` &mdash; an alias of `notDeepEqual()`.
160
+ * `notEquivalent()` &mdash; an alias of `notDeepEqual()`.
161
+ * `notDeeply()` &mdash; an alias of `notDeepEqual()`.
162
+ * `isNotDeepEqual()` &mdash; an alias of `notDeepEqual()`.
163
+ * `isNotEquivalent()` &mdash; an alias of `notDeepEqual()`.
164
+ * `deepLooseEqual(a, b, msg)` &mdash; asserts that `a` and `b` are deeply loosely equal.
165
+ * Individual components of `a` and `b` are compared recursively using the loose equality.
166
+ * `notDeepLooseEqual(a, b, msg)` &mdash; asserts that `a` and `b` are not deeply loosely equal.
167
+ * `throws(fn, msg)` &mdash; asserts that `fn` throws.
168
+ * `fn` is called with no arguments in the global context.
169
+ * `doesNotThrow(fn, msg)` &mdash; asserts that `fn` does not throw.
170
+ * `matchString(string, regexp, msg)` &mdash; asserts that `string` matches `regexp`.
171
+ * `doesNotMatchString(string, regexp, msg)` &mdash; asserts that `string` does not match `regexp`.
172
+ * `match(a, b, msg)` &mdash; asserts that `a` matches `b`.
173
+ * See [deep6's match()](https://github.com/uhop/deep6/wiki/match()) for details.
174
+ * `doesNotMatch(a, b, msg)` &mdash; asserts that `a` does not match `b`.
175
+ * `rejects(promise, msg)` &mdash; asserts that `promise` rejects.
176
+ * This is an asynchronous method. It is likely to be waited for.
177
+ * `doesNotResolve()` &mdash; an alias of `rejects()`.
178
+ * `resolves(promise, msg)` &mdash; asserts that `promise` resolves.
179
+ * This is an asynchronous method. It is likely to be waited for.
180
+ * `doesNotReject()` &mdash; an alias of `resolves()`.
181
+ * Embedded test suites (all of them are asynchronous and should be waited for):
182
+ * `test(name, options, testFn)` &mdash; runs a test suite asynchronously. See `test()` above.
183
+ * `skip(name, options, testFn)` &mdash; skips a test suite asynchronously. See `test.skip()` above.
184
+ * `todo(name, options, testFn)` &mdash; runs a provisional test suite asynchronously. See `test.todo()` above.
185
+ * `asPromise(name, options, testPromiseFn)` &mdash; runs a test suite asynchronously. See `test.asPromise()` above.
186
+ * Miscellaneous:
187
+ * `any` &mdash; returns the `any` object. It can be used in deep equivalency asserts to match any value.
188
+ See [deep6's any](https://github.com/uhop/deep6/wiki/any) for details.
189
+ * `plan(n)` &mdash; sets the number of tests in the test suite. Rarely used.
190
+ * `comment(msg)` &mdash; sends a comment to the test harness. Rarely used.
191
+ * `skipTest(...args, msg)` &mdash; skips the current test yet sends a message to the test harness.
192
+ * `bailOut(msg)` &mdash; stops the test suite and sends a message to the test harness.
193
+
194
+ In all cases, the `msg` message is optional. If it is not provided, some suitable generic message will be used.
195
+
196
+ Example:
197
+
198
+ ```js
199
+ test('Sample test', async t => {
200
+ const result = await getFromDb({first: 'Bob', last: 'Smith'});
201
+ t.equal(result.position, 'chief bozo', 'the position is correct');
202
+ t.ok(result.manager, 'the manager exists');
203
+
204
+ const manager = await getFromDb(result.manager);
205
+ t.ok(manager, 'the manager is retrieved');
206
+ t.equal(manager.first, 'Jane', 'the manager is Jane');
207
+ t.deepEqual(manager.employees, ['Bob Smith'], 'Jane manages only Bob Smith');
208
+ });
209
+ ```
210
+
211
+ ### Running tests
212
+
213
+ It is super easy to run tests:
214
+
215
+ 1. Install the `tape-six` package: `npm i -D tape-six`
216
+ 2. Write a test. For example, you named it `test.js`.
217
+ 3. Run the test: `node test.js`
218
+ 1. Or: `bun run test.js`
219
+ 2. Or: `deno run -A test.js`
220
+ 3. Or you can run them in a browser!
221
+ 4. Profit!
222
+
223
+ If you have a lot of tests, you can organize them using multiple files and directories.
224
+ `tape-six` provides multiple test runners that can run them in different environments.
225
+
226
+ ### Configuring test runners
227
+
228
+ See [set-up tests](https://github.com/uhop/tape-six/wiki/Set-up-tests) for details.
229
+
230
+ ### Command-line utilities
231
+
232
+ * [tape6](https://github.com/uhop/tape-six/wiki/Utility-%E2%80%90-tape6) &mdash; the main utility of the package to run tests in different environments.
233
+ * [tape6-server](https://github.com/uhop/tape-six/wiki/Utility-%E2%80%90-tape6-server) &mdash; a custom web server with a web application that helps running tests in browsers.
30
234
 
31
235
  ## Release notes
32
236
 
33
237
  The most recent releases:
34
238
 
239
+ * 1.0.1 *Technical release: added more links.*
240
+ * 1.0.0 *The first official release.*
35
241
  * 0.12.3 *Technical release: exposed internal classes for external utilities.*
36
242
  * 0.12.2 *Fixed a minor serialization issue.*
37
243
  * 0.12.1 *Minor Deno-related refactoring, fixed the way tests are triggered.*
package/bin/tape6-bun.js CHANGED
@@ -38,7 +38,7 @@ const config = () => {
38
38
  d: 'showData',
39
39
  o: 'failOnce',
40
40
  n: 'showAssertNumber',
41
- c: 'hasColors'
41
+ m: 'monochrome'
42
42
  };
43
43
 
44
44
  let flagIsSet = false,
@@ -103,7 +103,7 @@ const init = async () => {
103
103
  reporter = ttyReporter.report.bind(ttyReporter);
104
104
  }
105
105
  if (!reporter) {
106
- const tapReporter = new TapReporter({useJson: true});
106
+ const tapReporter = new TapReporter({useJson: true, hasColors: !options.monochrome});
107
107
  reporter = tapReporter.report.bind(tapReporter);
108
108
  }
109
109
  setReporter(reporter);
package/bin/tape6-deno.js CHANGED
@@ -38,7 +38,7 @@ const config = () => {
38
38
  d: 'showData',
39
39
  o: 'failOnce',
40
40
  n: 'showAssertNumber',
41
- c: 'hasColors'
41
+ m: 'monochrome'
42
42
  };
43
43
 
44
44
  let flagIsSet = false,
@@ -103,7 +103,7 @@ const init = async () => {
103
103
  reporter = ttyReporter.report.bind(ttyReporter);
104
104
  }
105
105
  if (!reporter) {
106
- const tapReporter = new TapReporter({useJson: true});
106
+ const tapReporter = new TapReporter({useJson: true, hasColors: !options.monochrome});
107
107
  reporter = tapReporter.report.bind(tapReporter);
108
108
  }
109
109
  setReporter(reporter);
package/bin/tape6-node.js CHANGED
@@ -39,7 +39,7 @@ const config = () => {
39
39
  d: 'showData',
40
40
  o: 'failOnce',
41
41
  n: 'showAssertNumber',
42
- c: 'hasColors'
42
+ m: 'monochrome'
43
43
  };
44
44
 
45
45
  let flagIsSet = false,
@@ -104,7 +104,7 @@ const init = async () => {
104
104
  reporter = ttyReporter.report.bind(ttyReporter);
105
105
  }
106
106
  if (!reporter) {
107
- const tapReporter = new TapReporter({useJson: true});
107
+ const tapReporter = new TapReporter({useJson: true, hasColors: !options.monochrome});
108
108
  reporter = tapReporter.report.bind(tapReporter);
109
109
  }
110
110
  setReporter(reporter);
package/bin/tape6.js CHANGED
File without changes
package/index.js CHANGED
@@ -19,7 +19,8 @@ const optionNames = {
19
19
  d: 'showData',
20
20
  o: 'failOnce',
21
21
  n: 'showAssertNumber',
22
- c: 'hasColors'
22
+ m: 'monochrome',
23
+ j: 'useJsonL'
23
24
  };
24
25
 
25
26
  const init = async () => {
@@ -60,6 +61,10 @@ const init = async () => {
60
61
  reporter = event => window.__tape6_reporter(id, event);
61
62
  } else if (window.parent && typeof window.parent.__tape6_reporter == 'function') {
62
63
  reporter = event => window.parent.__tape6_reporter(id, event);
64
+ } else if (options.useJsonL) {
65
+ const JSONLReporter = (await import('./src/JSONLReporter.js')).default,
66
+ jsonlReporter = new JSONLReporter(options);
67
+ reporter = jsonlReporter.report.bind(jsonlReporter);
63
68
  }
64
69
  } else if (isDeno) {
65
70
  if (Deno.env.TAPE6_JSONL) {
@@ -93,7 +98,7 @@ const init = async () => {
93
98
  }
94
99
  }
95
100
  if (!reporter) {
96
- const tapReporter = new TapReporter({useJson: true, hasColors: options.hasColors});
101
+ const tapReporter = new TapReporter({useJson: true, hasColors: !options.monochrome});
97
102
  reporter = tapReporter.report.bind(tapReporter);
98
103
  }
99
104
  setReporter(reporter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tape-six",
3
- "version": "0.12.3",
3
+ "version": "1.0.1",
4
4
  "description": "TAP the test harness for the modern JavaScript (ES6).",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -64,6 +64,6 @@
64
64
  }
65
65
  },
66
66
  "devDependencies": {
67
- "puppeteer": "^23.4.1"
67
+ "puppeteer": "^23.5.1"
68
68
  }
69
69
  }
@@ -1,5 +1,5 @@
1
1
  class JSONLReporter {
2
- constructor({renumberAsserts = false}) {
2
+ constructor({renumberAsserts = false} = {}) {
3
3
  this.renumberAsserts = renumberAsserts;
4
4
  this.assertCounter = 0;
5
5
  }
package/src/Tester.js CHANGED
@@ -398,11 +398,11 @@ setAliases('ok', 'true, assert');
398
398
  setAliases('notOk', 'false, notok');
399
399
  setAliases('error', 'ifError, ifErr, iferror');
400
400
  setAliases('strictEqual', 'is, equal, equals, isEqual, strictEquals');
401
- setAliases('notStrictEqual', 'not, notEqual, notEquals, isNotEqual, doesNotEqual, isInequal, notStrictEquals, isNot');
401
+ setAliases('notStrictEqual', 'not, notEqual, notEquals, isNotEqual, doesNotEqual, isUnequal, notStrictEquals, isNot');
402
402
  setAliases('looseEqual', 'looseEquals');
403
403
  setAliases('notLooseEqual', 'notLooseEquals');
404
404
  setAliases('deepEqual', 'same, deepEquals, isEquivalent');
405
- setAliases('notDeepEqual', 'notSame, notDeepEquals, notEquivalent, notDeeply, isNotDeepEqual, isNotDeepEqual, isNotEquivalent, isInequivalent');
405
+ setAliases('notDeepEqual', 'notSame, notDeepEquals, notEquivalent, notDeeply, isNotDeepEqual, isNotEquivalent');
406
406
  setAliases('rejects', 'doesNotResolve');
407
407
  setAliases('resolves', 'doesNotReject');
408
408
 
package/web-app/index.js CHANGED
@@ -3,13 +3,25 @@ import {getReporter, setReporter, setConfiguredFlag} from '../src/test.js';
3
3
  import defer from '../src/utils/defer.js';
4
4
  import State, {StopTest} from '../src/State.js';
5
5
  import TapReporter from '../src/TapReporter.js';
6
+ import JSONLReporter from '../src/JSONLReporter.js';
6
7
  import DomReporter from './DomReporter.js';
7
8
  import DashReporter from './DashReporter.js';
8
9
  import TestWorker from './TestWorker.js';
9
10
 
10
11
  setConfiguredFlag(true); // we are running the show
11
12
 
12
- const optionNames = {f: 'failureOnly', t: 'showTime', b: 'showBanner', d: 'showData', o: 'failOnce', s: 'showStack', l: 'showLog', n: 'showAssertNumber'},
13
+ const optionNames = {
14
+ f: 'failureOnly',
15
+ t: 'showTime',
16
+ b: 'showBanner',
17
+ d: 'showData',
18
+ o: 'failOnce',
19
+ s: 'showStack',
20
+ l: 'showLog',
21
+ n: 'showAssertNumber',
22
+ m: 'monochrome',
23
+ j: 'useJsonL'
24
+ },
13
25
  options = {};
14
26
 
15
27
  let flags = '',
@@ -62,10 +74,23 @@ window.addEventListener('DOMContentLoaded', () => {
62
74
  };
63
75
  }
64
76
 
65
- const tapReporter = new TapReporter({useJson: true}),
66
- domReporter = new DomReporter({root: document.querySelector('.tape6 .report')}),
67
- dashReporter = new DashReporter();
68
- setReporter(event => (options.showLog && tapReporter.report(event), domReporter.report(event), dashReporter.report(event)));
77
+ const dashReporter = new DashReporter(),
78
+ domReporter = new DomReporter({root: document.querySelector('.tape6 .report')});
79
+
80
+ let textReporter = null;
81
+ if (options.showLog) {
82
+ textReporter = options.useJsonL
83
+ ? new JSONLReporter()
84
+ : new TapReporter({useJson: true, hasColors: !options.monochrome});
85
+ }
86
+
87
+ setReporter(
88
+ event => (
89
+ textReporter && textReporter.report(event),
90
+ domReporter.report(event),
91
+ dashReporter.report(event)
92
+ )
93
+ );
69
94
 
70
95
  const donut = document.querySelector('tape6-donut');
71
96
  donut.show([{value: 0, className: 'nothing'}], {
@@ -92,9 +117,9 @@ window.addEventListener('DOMContentLoaded', () => {
92
117
 
93
118
  if (window.location.search) {
94
119
  if (patterns && patterns.length) {
95
- files = await fetch('/--patterns?' + patterns.map(pattern => 'q=' + encodeURIComponent(pattern)).join('&')).then(response =>
96
- response.ok ? response.json() : null
97
- );
120
+ files = await fetch(
121
+ '/--patterns?' + patterns.map(pattern => 'q=' + encodeURIComponent(pattern)).join('&')
122
+ ).then(response => (response.ok ? response.json() : null));
98
123
  }
99
124
  }
100
125
 
@@ -107,7 +132,9 @@ window.addEventListener('DOMContentLoaded', () => {
107
132
  return;
108
133
  }
109
134
 
110
- const importmap = await fetch('/--importmap').then(response => (response.ok ? response.json() : null));
135
+ const importmap = await fetch('/--importmap').then(response =>
136
+ response.ok ? response.json() : null
137
+ );
111
138
  if (importmap) options.importmap = importmap;
112
139
 
113
140
  const rootState = new State(null, {callback: getReporter(), failOnce: options.failOnce}),