https://github.com/markandre13/wtrspecreporter
Mocha Spec Style Reporter for Web Test Runner
https://github.com/markandre13/wtrspecreporter
Last synced: about 1 year ago
JSON representation
Mocha Spec Style Reporter for Web Test Runner
- Host: GitHub
- URL: https://github.com/markandre13/wtrspecreporter
- Owner: markandre13
- Created: 2021-11-27T16:53:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-28T11:05:22.000Z (over 4 years ago)
- Last Synced: 2025-02-05T01:51:16.604Z (over 1 year ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Goodbye Karma, Welcome Web Test Runner & Snowpack, ...
A while ago I noticed that [toad.js](https://github.com/markandre13/toad.js)' unit tests did not run anymore.
As I like to run the unit tests in a real browser, I had choosen Angular's [Karma](https://karma-runner.github.io/latest/index.html). Setting it up to run Typescript with correct sourcemaps had been quite a challenge in the past and with the new errors, I saw no reason so sink any more time into it, especially
since [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) there's no need to bundle anymore during development.
After getting [Vite](https://vitejs.dev) and [mocha-vite-puppeteer](https://github.com/larsthorup/mocha-vite-puppeteer) to work, I ran into some issues with esbuild and... wrong line numbers. And I also
wanted something more modular and flexible.
So I took a look at [snowpack](https://www.snowpack.dev) and [web-test-runner](https://modern-web.dev/docs/test-runner/overview/) and found that it provides exactly what I needed: Typescript, Mocha, Chai and a real browser for the DOM.
The only thing missing was a reporter looking like [mocha's spec reporter](https://mochajs.org/#test-duration) or [karma-mocha-reporter](https://www.npmjs.com/package/karma-mocha-reporter).
So here it is: [WTRSpecReporter.js](WTRSpecReporter.js) and that's how it looks: