NEXT.JS · CONSOLE-FIRST TESTING

One console command.
Test server data, too.

Reproduce the data and page states you need during development, straight from the console.
Empty lists, different prices, error responses. Keep your fetch calls.

npm i @uiwwsw/next-test-mode→npx @uiwwsw/next-test-mode init
TRY IT IN YOUR BROWSER

Change the data. Check the page.

Connecting…
DEVTOOLS → CONSOLEtest.patch('/api/cart.json', { total: 9.99 })
01

Enter your test data

JSON

The console and editor use the same package API.
Change the data and the page refreshes automatically.

02

Check the updated result

HTTP 200LIVE PREVIEW
Cart total42
{
  "items": [
    {
      "name": "Canvas tote",
      "price": 24
    },
    {
      "name": "Everyday mug",
      "price": 18
    }
  ],
  "total": 42
}

Only your test session changes. Values survive reloads and are shared by tabs in the same browser. Use test.clear() to finish testing.

01 / SAME CALLS

Keep your fetch calls.

Connect once at startup and keep using your existing fetch calls.

02 / YOUR SCENARIOS

Keep reusable scenarios together.

Try one-off values in the console. Edit and share reusable scenarios in a separate folder.

03 / QUICK FEEDBACK

Check the states you need.

From empty lists to error responses, change the data and check the actual page.

Next.js API mocking and frontend QA

Next Test Mode is a fetch mocking and response-patching tool for Next.js development. Reproduce loading, empty, error and custom data states without replacing your existing API client. Explore client rendering and session-scoped server, static and ISR previews in this demo.

Installation and supported rendering modes ↗