/typescript:testingfrom typescript
Use when writing, running, or debugging TypeScript tests, covering Vitest and @effect/vitest, isolation options, type tests, benchmarks, controlled time, in-memory contract clients, service doubles, generated inputs, fixtures, browser and Workers suites, containers, and Playwright
Ships in typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Covers suites Vitest runs through a vitest.config.ts and Playwright through a playwright.config.ts. Use code:test for test design: oracles, cases, structure, independence, doubles, generated-input kinds, and grading.
Tests use each module below before a hand form:
| [INDEX] | [FIELD] | [MODULES] |
|---|---|---|
| [01] | Runner, assertions | vitest, @effect/vitest (it, layer, assert) |
| [02] | Controlled time and console | TestClock, TestConsole of effect/testing |
| [03] | Schema codecs | TestSchema.Asserts of effect/testing |
| [04] | Generated inputs | effect/Arbitrary through it.prop and it.effect.prop |
| [05] | Contract clients, servers | HttpApiTest, NodeHttpServer.layerTest, McpTest, RpcTest, GraphQLClient.layerTest, ChatTest |
| [06] | Cluster, workflow | Entity.makeTestClient, TestRunner.layer, WorkflowEngine.layerMemory |
| [07] | Platform doubles | FileSystem.make, Stdio.layerTest, Terminal.make, ChildProcessSpawner.make |
| [08] | Services in containers | testcontainers, @testcontainers/* |
| [09] | Chromium | @vitest/browser-playwright, vitest-browser-react, @playwright/test, @axe-core/playwright |
| [10] | Firefox | selenium-webdriver |
| [11] | Workers runtime | @cloudflare/vitest-plugin (cloudflare:test, cloudflare:workers) |
[REFERENCES]:
fetch, and what each client encodesvitest run runs each project of a vitest.config.ts, and playwright test each project of a playwright.config.ts:
vitest run <file> -t '<title>' runs the tests of one file a title matchesallowOnly: false and update: 'none' fail a run holding a .only test or a missing snapshottestTimeout and hookTimeout bound hangs alone, so each wait a test makes states its own deadlinesilent: 'passed-only' prints the console of failing tests, and truncateThreshold: 0 prints each compared value wholeflakyTest of @effect/vitest and the Vitest retry option turn a flaky failure green and stay out of every suiteWorkspace roots build one Vitest project per manifest naming vitest, its dev dependencies selecting the environment, first row winning:
| [INDEX] | [DEPENDENCY] | [ENVIRONMENT] |
|---|---|---|
| [01] | @storybook/addon-vitest | Stories as tests in headless Chromium |
| [02] | vitest-browser-react | Components in headless Chromium through Playwright |
| [03] | @cloudflare/vitest-plugin | *.workers.test.ts in workerd, other files in Node |
| [04] | vitest | Node |
@effect/vitest registers effects as tests, each in a scope closing when its test ends:
| [INDEX] | [MEMBER] | [SERVICES] | [USE] |
|---|---|---|---|
| [01] | it.effect | TestClock, TestConsole | Logic over time, retries, schedules, logs |
| [02] | it.live | Live services | Sockets, processes, files, real deadlines |
| [03] | layer(L, options)(name, (it) => ...) | L, test services unless excluded | Services built once for a block |
| [04] | it.effect.each(rows) | As it.effect | One case per row through Vitest it.for |
| [05] | it.prop, it.effect.prop | As their tester, no fixtures | Properties over arbitraries |
| [06] | makeMethods(test.extend(...)) | Vitest fixtures | Effect tests reading fixtures |
| [07] | beforeAll, beforeEach | Hook scope | Effect setup released after suite or test |
layer offer it.effect and no it.live, and excludeTestServices: true runs their tests on live services, the form for sockets, containers, and processes{ buildPerTest: true } builds per test, so a failure fails that test aloneit.layer blocks build into a fork of their parent's memo map, reusing services the parent builtEffect.fnUntraced(function* () { ... }) generators, and describe(<function>, ...) titles a block with the function under test'$case refuses $input') and primitives (%s), so a failure names its rowAssertions compare observed facts against values written in the test:
assert.deepStrictEqual(<facts>, <want>) compares one tuple or record of facts against a literal, printing both sidesOption.none(), Exit.fail(error)), and @effect/vitest/utils members (assertSome, assertFailure, assertExitFailure) narrow the type beside the comparisonEffect.flip returns an expected failure, and the test asserts its reason._tag and subject, as an assertion that something failed passes for every wrong failureEffect.exit keeps defects and interruptions for an Exit or Cause assertionaddEqualityTesters() registers no tester in 4.1.6, so no assertion reads Equal, and values Equal compares (HashSet, HashMap) convert to sorted arrays firstexpect.schemaMatching(Schema.toStandardSchemaV1(S)) accepts any value S decodes, for a field holding a value of one run (a span's instants)TestClock starts at epoch 0 and moves through TestClock.adjust(duration) and TestClock.setTime(millis) alone, each running every sleep due by the new time in order:
Effect.forkChild), the test moves the clock, then joins the fiber and assertssetTime (a signature made at one instant, verified at each tolerance offset)TestClock.withLive(effect) runs one effect on the live clock inside it.effectA test is using time, but is not advancing the test clock after one second, naming the hangTestConsole.logLines and errorLines return what Console wrote, for code whose output is its behaviorClock service, so its tests move TestClock in place of vi.useFakeTimersAsync tests await each event they assert and observe absence after its source ends:
Deferred the test awaits in place of a sleep or pollQueue or Ref a double writes, read once the source under test ends, so a count of zero is exactit.live bounds each wait through Effect.timeoutOrElse, failing with a reason naming what never arrivedexpect.poll and expect.element, which retry until their deadlineonTestFinished releases what a test outside Effect opened, in reverse registration orderTests own what they create under a name no other test uses, released when their scope ends:
fs.makeTempDirectoryScoped() in Effect and mkdtempDisposableSync outside it, and servers listen on port 0Effect.acquireDisposable or Effect.acquireRelease in the test's scope, and through onTestFinished outside Effectvi.stubEnv sets reset through vi.unstubAllEnvstest.extend('<name>', { scope }, fn) declares a fixture returning its value with onCleanup releasing it, scope 'test', 'file', or 'worker'({}, use) reading none, as Vitest and Playwright refuse other formsSuites are private packages, one per tested project:
devDependencies every package a suite imports, its product through workspace:*"imports": { "#/*": "./*.ts" } reaches a suite's own helpers as #/<file>, and products import by package namefixtures.ts, rows.ts), and a harness a second suite needs moves to a shared test package.test.ts or .test.tsx for Vitest, .workers.test.ts for workerd, .spec.ts for Playwright, and .media.ts for store mediaWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bsamiee/rasm --plugin typescript4 skills in this plugin
/codingUse when writing or reviewing TypeScript, covering functional design with Effect, Schema, and algebraic data types/debuggingUse when JavaScript or TypeScript misbehaves at runtime in Node, a browser page, a worker, a test runner, or a single executable and its cause is unproven, covering js-debug launch and attach routes, child programs, source maps, exception filters, Node's probe mode, and the evidence Node writes/effectUse when calling an Effect module family, covering HttpApi, HTTP clients and routes, RPC, sockets and atoms, SQL, AI, MCP and chat platforms, child processes, workers and CLIs, persistence and durable execution, files, encodings, crypto, and telemetryOther plugins' skills for the same job