https://github.com/oscarmarina/reporters-array
Example - crash when using multiple reports with @web/test-runner (reporters: [defaultReporter(), mochaReporter()])
https://github.com/oscarmarina/reporters-array
Last synced: 2 months ago
JSON representation
Example - crash when using multiple reports with @web/test-runner (reporters: [defaultReporter(), mochaReporter()])
- Host: GitHub
- URL: https://github.com/oscarmarina/reporters-array
- Owner: oscarmarina
- License: mit
- Created: 2021-09-12T08:08:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-16T11:57:35.000Z (over 3 years ago)
- Last Synced: 2025-02-08T09:13:03.803Z (4 months ago)
- Language: JavaScript
- Size: 343 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## When a new report is added the results of these overlap
- with `reporters: [mochaReporter()]`
- the `log` is correct and the 11 test are displayed
- with `reporters: [defaultReporter(), mochaReporter()]`
- both `logs` are mixed

### web-test-runner.config.mjs
```js
import { defaultReporter } from "@web/test-runner";
import { mochaReporter } from "@chialab/wtr-mocha-reporter";const filteredLogs = ["Running in dev mode", "lit-html is in dev mode"];
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
/** Test files to run */
files: "test/**/*.test.js",/** Resolve bare module imports */
nodeResolve: {
exportConditions: ["browser", "development"],
},// OK
//reporters: [mochaReporter()],// OK
// reporters: [defaultReporter()],// fail
reporters: [defaultReporter(), mochaReporter()],// fail
/* reporters: [
defaultReporter({
reportTestResults: false,
reportTestProgress: true,
}),
mochaReporter(),
], */// OK
/* reporters: [
defaultReporter({
reportTestResults: false,
reportTestProgress: false,
}),
mochaReporter(),
], */// more or less
/* reporters: [
defaultReporter({
reportTestResults: true,
reportTestProgress: false,
}),
mochaReporter(),
], */
...
...
...
});
```# \
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
## Installation
```bash
npm i reporters-array
```## Usage
```html
import 'reporters-array/reporters-array.js';
```
## Testing with Web Test Runner
To execute a single test run:
```bash
npm run test
```To run the tests in interactive watch mode run:
```bash
npm run test:watch
```## Tooling configs
For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
If you customize the configuration a lot, you can consider moving them to individual files.
## Local Demo with `web-dev-server`
```bash
npm start
```To run a local development server that serves the basic demo located in `demo/index.html`