···11+# Extending default reporters
22+33+You can import reporters from `vitest/reporters` and extend them to create your custom reporters.
44+55+## Extending built-in reporters
66+77+In general, you don't need to create your reporter from scratch. `vitest` comes with several default reporting programs that you can extend.
88+99+```ts
1010+import { DefaultReporter } from 'vitest/reporters'
1111+1212+export default class MyDefaultReporter extends DefaultReporter {
1313+ // do something
1414+}
1515+```
1616+1717+Of course, you can create your reporter from scratch. Just extend the `BaseReporter` class and implement the methods you need.
1818+1919+And here is an example of a custom reporter:
2020+2121+```ts
2222+// ./custom-reporter.ts
2323+import { BaseReporter } from 'vitest/reporters'
2424+2525+export default class CustomReporter extends BaseReporter {
2626+ onCollected() {
2727+ const files = this.ctx.state.getFiles(this.watchFilters)
2828+ this.reportTestSummary(files)
2929+ }
3030+}
3131+```
3232+3333+Or implement the `Reporter` interface:
3434+3535+```ts
3636+// ./custom-reporter.ts
3737+import { Reporter } from 'vitest/reporters'
3838+3939+export default class CustomReporter implements Reporter {
4040+ onCollected() {
4141+ // print something
4242+ }
4343+}
4444+```
4545+4646+Then you can use your custom reporter in the `vitest.config.ts` file:
4747+4848+```ts
4949+import { defineConfig } from 'vitest/config'
5050+import CustomReporter from './custom-reporter.js'
5151+5252+export default defineConfig({
5353+ test: {
5454+ reporters: [new CustomReporter()],
5555+ },
5656+})
5757+```
5858+5959+## Exported reporters
6060+6161+`vitest` comes with a few built-in reporters that you can use out of the box.
6262+6363+### Built-in reporters:
6464+6565+1. `BasicReporter`
6666+1. `DefaultReporter`
6767+2. `DotReporter`
6868+3. `JsonReporter`
6969+4. `VerboseReporter`
7070+5. `TapReporter`
7171+6. `JUnitReporter`
7272+7. `TapFlatReporter`
7373+8. `HangingProcessReporter`
7474+7575+### Base Abstract reporters:
7676+7777+1. `BaseReporter`
7878+7979+### Interface reporters:
8080+8181+1. `Reporter`