Skip to main content
Home

Built and signed on GitHub Actions

latest

An abstract helper for integrating Effection with testing frameworks.

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
70%
Published
3 months ago (0.1.1)

Test Adapter

An abstract helper for integrating Effection with testing frameworks.


Typically, you won't use this module directly, but instead you'll use one of the actual testing framework integrations. The following shows how you might integrate it with the @std/bdd module. You would never use it this way, this demonstrates the general pattern of lifecycle.

import { run, sleep } from "effection";
import { createTestAdapter, TestAdapter } from "@effectionx/test-adapter";
import { describe, it, beforeEach } from "@std/bdd";


describe("something", () => {
  let adapter: TestAdapter;
  beforeAll(() => {)
    adapter = createTestAdapter("something");
  });
  
  afterAll(() => adapter.destroy())
  
  adapter.addSetup(function*() {
    /* do some setup. equivalent of beforeEach() */
	/* contexts set here will be visible in the test */*
  });
  
  it("does a thing", async () => {
    await adapter.runTest(function*() {
	  /* ... the body of the test */
	});
  });

});
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";
or

Import directly with a jsr specifier

import * as test_adapter from "jsr:@effectionx/test-adapter";

Add Package

pnpm i jsr:@effectionx/test-adapter
or (using pnpm 10.8 or older)
pnpm dlx jsr add @effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";

Add Package

yarn add jsr:@effectionx/test-adapter
or (using Yarn 4.8 or older)
yarn dlx jsr add @effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";

Add Package

vlt install jsr:@effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";

Add Package

npx jsr add @effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";

Add Package

bunx jsr add @effectionx/test-adapter

Import symbol

import * as test_adapter from "@effectionx/test-adapter";