mocha-ws-reporter
v0.1.4
Published
Standard Mocha HTML reporter which also emits over a Websocket
Readme
mocha-ws-reporter
Want to run Mocha in the browser and collect test report data over a WebSocket connection? You've come to the right place!
This reporter utilises the standard Mocha HTML reporter so that everything will work as per usual in the browser whilst also emitting the report over a WebSocket for you to collect elsewhere.
Install
NPM
> npm i mocha-ws-reporterUnpkg CDN
<script type="module">
import { wsReporter } from "https://www.unpkg.com/[email protected]"
</script>Use
<script type="module">
import { wsReporter } from "https://www.unpkg.com/[email protected]"
mocha.setup({
ui: "bdd",
reporter: wsReporter({
port: 7777, // this is the default port value
}),
})
</script>Note that the reporter will automatically call mocha.run as soon as the socket connection is open so there's no need to do that yourself.
