Julien-R44 / japa-vscode

🧪 A Japa extension for VSCode
https://marketplace.visualstudio.com/items?itemName=jripouteau.japa-vscode
MIT License
17 stars 2 forks source link

Configuring test explorer with @japa/reporter ndjson? #10

Closed kenenisa closed 1 year ago

kenenisa commented 1 year ago

I see on the Instructions section there is

import { configure, processCLIArgs, run } from '@japa/runner'
import { assert } from '@japa/assert'
import { ndjson, spec } from '@japa/reporters'

processCLIArgs(process.argv.splice(2))
configure({
  files: ['tests/**/*.spec.js'],
  plugins: [assert()],
  reporters: {
    activated: ['spec'],
    list: [ndJson(), spec()], // 👈 Make sure to include ndjson
  }
})

but i can't seem to find ndjson nor the package @japa/reporters. All i can find is @japa/spec-reporter which is used for the spec reporter. I am using japa with adonisjs so i'm configuring japa through tests/bootstrap.ts. I can add reporters here

/*
|--------------------------------------------------------------------------
| Japa Reporters
|--------------------------------------------------------------------------
|
| Japa reporters displays/saves the progress of tests as they are executed.
| By default, we register the spec reporter to show a detailed report
| of tests on the terminal.
|
*/
export const reporters: Required<Config>['reporters'] = [specReporter()]

But i don't know how to add ndjson here. help?

Julien-R44 commented 1 year ago

Right now you can't do that To be able to run the tests within the vscode test explorer, you need version 3.0.0 of Japa which is ESM only, and therefore incompatible with Adonis 5

Julien-R44 commented 1 year ago

Closing the issue, feel free to re-open if needed