OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / brittle / api-extract.json

113 lines · json ref:
{
  "repo": "brittle",
  "timestamp": "2026-01-16T23:39:35.984Z",
  "entryPoint": "index.js",
  "exports": {
    "packageJson": {
      "main": "index.js"
    }
  },
  "api": {
    "file": "index.js",
    "exports": [
      {
        "type": "default",
        "name": "test"
      }
    ],
    "classes": [
      {
        "name": "Runner"
      },
      {
        "name": "Test"
      }
    ],
    "functions": [
      {
        "name": "configure"
      },
      {
        "name": "highDefTimerNode"
      },
      {
        "name": "highDefTimerFallback"
      },
      {
        "name": "cmp"
      },
      {
        "name": "test"
      },
      {
        "name": "hook"
      },
      {
        "name": "solo"
      },
      {
        "name": "skip"
      },
      {
        "name": "todo"
      },
      {
        "name": "pause"
      },
      {
        "name": "resume"
      },
      {
        "name": "wait"
      },
      {
        "name": "loop"
      },
      {
        "name": "tickish"
      },
      {
        "name": "explain"
      },
      {
        "name": "originFrame"
      },
      {
        "name": "isPromise"
      },
      {
        "name": "isUncaught"
      },
      {
        "name": "getRunner"
      },
      {
        "name": "prematureEnd"
      },
      {
        "name": "stealth"
      }
    ]
  },
  "readme": {
    "content": "# brittle\n\n> tap à la mode\n\nA TAP test runner built for modern times.\n\n<img width=300 height=200 src=brittle.png>\n\n## Usage\n\nFirst install brittle from npm\n\n```\nnpm i brittle\n```\n\nThen start writing tests\n\n```javascript\nimport test from 'brittle'\n\ntest('basic', function (t) {\n  t.is(typeof Date.now(), 'number')\n  t.not(typeof Date.now(), 'string')\n\n  t.ok(Date.now() > 0)\n  t.absent(null)\n\n  t.comment('text')\n\n  t.alike({ a: 1 }, { a: 1 })\n  t.unlike({ a: 2 }, { a: 3 })\n\n  t.pass()\n  t.fail()\n})\n\ntest('asynchronous', async function (t) {\n  await new Promise(r => setTimeout(r, 250))\n  t.pass()\n})\n\ntest('plans', function (t) {\n  t.plan(2)\n  t.pass()\n  setTimeout(() => t.pass(), 250)\n})\n\ntest('classic subtest', function (t) {\n  t.test('subtest', function (sub) {\n    sub.plan(1)\n    sub.pass()\n  })\n})\n\ntest('inverted subtest', function (t) {\n  const sub = t.test('subtest')\n  sub.plan(1)\n  sub.pass()\n})\n\ntest('executions', async function (t) {\n  t.execution(() => 'should not throw')\n  await ",
    "sections": [
      "intro",
      "usage",
      "test runtimes",
      "api",
      "runner",
      "cli",
      "license"
    ],
    "hasApi": true,
    "hasExamples": true,
    "exampleCount": 32,
    "examples": [
      "npm i brittle",
      "import test from 'brittle'\n\ntest('basic', function (t) {\n  t.is(typeof Date.now(), 'number')\n  t.not(typeof Date.now(), 'string')\n\n  t.ok(Date.now() > 0)\n  t.absent(null)\n\n  t.comment('text')\n\n  t.alike({ a: 1 }, { a: 1 })\n  t.unlike({ a: 2 }, { a: 3 })\n\n  t.pass()\n  t.fail()\n})\n\ntest('asynchronous', async function (t) {\n  await new Promise(r => setTimeout(r, 250))\n  t.pass()\n})\n\ntest('plans', function (t) {\n  t.plan(2)\n  t.pass()\n  setTimeout(() => t.pass(), 250)\n})\n\ntest('classic subtest', function (t) {\n  t.test('subtest', function (sub) {\n    sub.plan(1)\n    sub.pass()\n  })\n})\n\ntest('inverted subtest', function (t) {\n  const sub = t.test('subtest')\n  sub.plan(1)\n  sub.pass()\n})\n\ntest('executions', async function (t) {\n  t.execution(() => 'should not throw')\n  await t.execution(async () => 'should not reject')\n})\n\ntest('exceptions', async function (t) {\n  t.exception(() => { throw Error('expected to throw') })\n  await t.exception(async () => { throw Error('expected to reject') })\n})\n\nconst a = test('inverted test without plan needs end()')\na.pass()\na.end()\n\nconst b = test('inverted test with plan')\nb.plan(1)\nb.pass()\n\nconst c = test('inverted tests can be awaited')\nc.plan(1)\nsetTimeout(() => c.pass(), 250)\nawait c",
      "import { test, solo, skip, hook, todo, configure } from 'brittle'"
    ]
  },
  "patterns": []
}