nitrojs / nitrojs/nitro

Add documentation for testing

Open
#2,303 1 comment 19 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Describe the feature

The docs currently contain zero informations about testing. I am moving my backend from Nuxt to a separate Nitro app especially to have better testing abilities (Nuxt test utils need 15s to prepare tests).

I wonder if there are even any testing utilities for Nitro to support running partial tests and have HMR? Open discussion: https://github.com/unjs/nitro/discussions/194

For comparison, here are the test docs from some other huge api frameworks which are very detailed:

Further I would suggest that Nitro provides more features/support for writing tests. E.g. an automatic bootstrap/setup of the Nitro app would be great as well as fetch function for internal routes and the possibility of mocking.

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Nitro discussion and review the testing documentation examples from NestJS and AdonisJS. Determine the scope of Nitro's testing utilities, including partial tests, HMR, app setup, internal-route fetching, and mocking; done should be a clear, agreed testing guide or a separately scoped implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
backend, documentation, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.