Skip to content

Japa Unit tests not working? #3508

Answered by arthur-er
ehni asked this question in Help
Jan 22, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Make sure to have the part that starts the http server:

async function startHttpServer() {
  const { Ignitor } = await import('@adonisjs/core/build/src/Ignitor')
  process.env.PORT = String(await getPort())
  await new Ignitor(__dirname).httpServer().start()
}

As this one is the part that sets up the ioc container global bindings (global[Symbol.for('ioc.use')]), required for using the aliases (in your case App/Util/UUIDGenerator)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ehni
Comment options

@arthur-er
Comment options

@arthur-er
Comment options

@ehni
Comment options

Answer selected by thetutlage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants