Skip to content

[v5] japa runner suite configuration not working with async code #3631

Answered by guntribam
guntribam asked this question in Help
Discussion options

You must be logged in to vote

Solved.

The correct way is to use the runner setup before the configureSuite setup

import 'reflect-metadata'
import sourceMapSupport from 'source-map-support'
import execa from 'execa'
import { assert } from '@japa/assert'
import { specReporter } from '@japa/spec-reporter'
import { processCliArgs, configure, run } from '@japa/runner'
import { join } from 'path'
import type { HttpServer } from '@adonisjs/core/build/src/Ignitor/HttpServer'
import { Ignitor } from '@adonisjs/core/build/src/Ignitor'

sourceMapSupport.install({ handleUncaughtExceptions: false })

async function setupServer() {
  let server: HttpServer;
  try {
    server = new Ignitor(join(__dirname, '..')).httpServer()
    await

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by guntribam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant