ladybird/Base/usr/share/man/man1/test-js.md
Linus Groh 8f3151eea8 Base: Add link to test-common.js in test-js(1) man page
This is an easy way to view this file as the link will open it in Text
Editor :^)
2020-07-07 17:42:50 +02:00

787 B

Name

test-js - run the LibJS test suite

Synopsis

$ test-js [options...]

Description

test-js runs the LibJS test suite located in /home/anon/js-tests. These tests are using a custom JavaScript testing framework inspired by Jest (see test-common.js).

Options

  • -t, --show-time: Show duration of each test

Examples

A very simple test looks like this:

describe("Examples from Gary Bernhardt's 'Wat' talk", () => {
    test("Na na na na na na na na na na na na na na na na Batman!", () => {
        expect(Array(16).join("wat" - 1) + " Batman!").toBe(
            "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!"
        );
    });
});

See also