nuxt / nuxt/test-utils

Using the server from multiple test files does multiple unneccessary build runs

Open
#268 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v0
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

Description

We are using multiple .test.ts - files to structure our tests. All of them are using the server and thus the configuration await setup({server: true, dev: false});

Watching the tests progress, I noticed that the server is built for every test file again. I my opinion this is an unneccessary waste of time. The server could be build a single time at the beginning of the test run.

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

The issue identifies multiple .test.ts files and the setup({server: true, dev: false}) call; start by tracing that setup path and observing when server builds are triggered across a test run. Done means the server builds once at the beginning of a run and is reused by all test files, with tests still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, typescript
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.