Skip to content

gaslamp


Function: describe()

describe(name, defineFn): TestSuite

Define a test suite.

Parameters

name

string

Suite name.

defineFn

(ctx) => void

Callback to register tests and hooks.

Returns

TestSuite

The created test suite.

Since

0.22.0

Example

JavaScript
const suite = gaslamp.JestLite.describe("Array methods", (ctx) => {
  ctx.test("map doubles values", () => {
    const result = [1, 2, 3].map(x => x * 2);
    expect(result).toEqual([2, 4, 6]);
  });
});