Skip to content

remix/test · Function

View Source

describe

Summary

Groups related tests into a named suite. Suites can be nested and will be displayed as such in reporter output. Lifecycle hooks registered inside a describe block apply only to tests within that block.

Signature

const describe: (name: string, fn: () => void) => void

const describe: (name: string, meta: SuiteMeta, fn: () => void) => void

Example

describe('auth', () => {
  it('logs in', async () => { ... })
})
describe('external service', { skip: 'requires API credentials' }, () => { ... })

// Modifiers
describe.skip('skipped suite', () => { ... })
describe.skip('skipped suite', 'blocked by missing fixture', () => { ... })
describe.only('focused suite', () => { ... })
describe.todo('planned suite')
describe.todo('planned suite', 'needs design input')

Parameters

name

The suite name shown in reporter output.

fn

A function that registers the tests and lifecycle hooks in this suite.

meta

Suite metadata such as skip, only, or todo.