• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

qunitjs / qunit / 9822612258
90%

Build:
DEFAULT BRANCH: main
Ran 06 Jul 2024 10:47PM UTC
Jobs 1
Files 37
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Jul 2024 10:42PM UTC coverage: 88.819% (-0.1%) from 88.938%
9822612258

push

github

Krinkle
Build: Make internal core compatible with native ESM

* Add explicit file extensions as per ESM standard, instead of relying
  on Node.js-specific require() resolution, or Rollup-specific ESM
  resolution for Node.js compat.

* As minor prep for external ESM support, move UMD export to
  the /src/qunit.js entrypoint. I considered adding an `export`
  statement to the entrypoint, but this interfers with generating
  the CJS distribution with Rollup the way we do today.

  - Adding `export default` to /src/qunit.js, creates a Rollup error
    about  `output: none` for input files that perform exports.
  - Setting `output: defaults` in Rollup config, creates a warning
    about having an export while using `format: iife` but having set
    no name for it.
  - Adding a name would change the output in a meaningful way,
    namely it would create an (implied global) variable in the form
    of `var QUnit = (function () { … return QUnit; }());`
  - Creating such variable using `var` instead of as `window.QUnit`
    means that it cannot be unset via `delete window.QUnit` which
    breaks certain test, and is out of the scope for this pathc.

* Fix fragile code in stracktrace.js that previously worked only because
  of Babel transformations masking a violation of the Temporal Dead Zone
  between `const fileName` and the functions it uses to compute that
  value.

```
$ node --experimental-detect-module
Welcome to Node.js v21.1.0.
Type ".help" for more information.
> await import("./src/qunit.js");
Uncaught ReferenceError: Cannot access 'fileName' before initialization
    at extractStacktrace (file:///Users/krinkle/Development/qunit/src/core/stacktrace.js:51:5)
    at sourceFromStacktrace (file:///Users/krinkle/Development/qunit/src/core/stacktrace.js:81:10)
    at file:///Users/krinkle/Development/qunit/src/core/stacktrace.js:35:19
    at …
    at async REPL
```

After this:

```
> await import("./src/qunit.js");
//> null
> (await import("./src/core.js")).def... (continued)

3 of 6 new or added lines in 2 files covered. (50.0%)

1827 of 2057 relevant lines covered (88.82%)

2135.2 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9822612258.1 29 Apr 56484 10:46PM UTC 0
88.82
GitHub Action Run
Source Files on build 9822612258
Detailed source file information is not available for this build.
  • Back to Repo
  • 95105aad on github
  • Prev Build on main (#9803176541)
  • Next Build on main (#9822891588)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc