Skip to main content

Documentation Index

Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

veryfront/testing

Cross-runtime test utilities — BDD framework (describe/it), assertions, test isolation, filesystem/env helpers, and timing utilities for Deno, Node, and Bun.

Import

import {
  afterAll,
  afterEach,
  assert,
  assertEquals,
  assertExists,
  assertGreater,
} from "veryfront/testing";

Examples

import { assertEquals, describe, it } from "veryfront/testing";

describe("math", () => {
  it("adds numbers", () => {
    assertEquals(1 + 1, 2);
  });
});

Exports

Functions

NameDescriptionSource
afterAllRegister a hook after all BDD tests in a group.source
afterEachRegister a hook after each BDD test.source
assertAssert that a value is truthy.source
assertEqualsAssert that two values are deeply equal.source
assertExistsAssert that a value is not null or undefined.source
assertGreaterAssert that a number is greater than another number.source
assertGreaterOrEqualAssert that a number is greater than or equal to another number.source
assertInstanceOfAssert that a value is an instance of a constructor.source
assertLessAssert that a number is less than another number.source
assertLessOrEqualAssert that a number is less than or equal to another number.source
assertMatchAssert that a string matches a regular expression.source
assertNotEqualsAssert that two values are not deeply equal.source
assertNotStrictEqualsAssert that two values are not strictly equal.source
assertObjectMatchAssert that an object contains matching properties.source
assertRejectsAssert that an async function rejects.source
assertStrictEqualsAssert that two values are strictly equal.source
assertStringIncludesAssert that a string contains another string.source
assertThrowsAssert that a synchronous function throws.source
beforeAllRegister a hook before all BDD tests in a group.source
beforeEachRegister a hook before each BDD test.source
chmodChange file permissions.source
createFileSystemCreate file system.source
cwdReturn the current working directory.source
deepEquals********************* Shared utility functions for cross-runtime testing. *********************source
delayWait for a duration in milliseconds.source
deleteEnvDelete a process environment variable.source
describeGroup related BDD tests.source
envRead and write process environment variables.source
existsCheck whether a path exists.source
exitExit the current process.source
failFail the current assertion immediately.source
getArgsGet command-line arguments (cross-runtime: Deno.args or process.argv).source
getEnvRead an environment variable from the active project scope.source
getTestTimeScaleReturn test time scale.source
isAlreadyExistsErrorError shape for is already exists.source
isNotFoundErrorError shape for is not found.source
itDefine a BDD test case.source
makeTempDirCreate temp dir.source
makeTempDirWithOptionsOptions accepted by make temp dir with.source
makeTempFileCreate temp file.source
mkdirCreate a directory.source
readDirRead directory entries.source
readFileRead a file as bytes.source
readTextFileRead a file as text.source
registerTestCleanupRegisters test cleanup.source
removeRemove a file or directory.source
resetAllTestStateComprehensive reset of ALL test state across the application.source
safeStringifySerialize unknown values safely for test output.source
scaleMsScale a duration for the current test runtime.source
setEnvSets env.source
statRead file metadata.source
testDelayWait for a test-scaled duration.source
waitForWait until a condition succeeds.source
withEnvApplies env.source
withTempDirApplies temp dir.source
withTempFileApplies temp file.source
writeFileWrite bytes to a file.source
writeTextFileWrite text to a file.source

Types

NameDescriptionSource
BddTestContextContext passed to hooks and tests (BDD-specific)source
TestOptionsTest options for Deno sanitizers (ignored in Node/Bun)source

Constants

NameDescriptionSource
isBunTrue if running in Bun runtime (check first since Bun has process.versions.node)source
isDenoTrue if running in real Deno runtime (not dnt shim)source
isNodeTrue if running in Node.js runtime (has process.versions.node, not Bun, not shimmed Deno)source
testShared test value.source

Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

veryfront/testing/assert

import { assert, assertEquals, assertExists } from "veryfront/testing/assert";

Functions

NameDescriptionSource
assertAssert that a value is truthy.source
assertEqualsAssert that two values are deeply equal.source
assertExistsAssert that a value is not null or undefined.source
assertGreaterAssert that a number is greater than another number.source
assertGreaterOrEqualAssert that a number is greater than or equal to another number.source
assertInstanceOfAssert that a value is an instance of a constructor.source
assertLessAssert that a number is less than another number.source
assertLessOrEqualAssert that a number is less than or equal to another number.source
assertMatchAssert that a string matches a regular expression.source
assertNotEqualsAssert that two values are not deeply equal.source
assertNotStrictEqualsAssert that two values are not strictly equal.source
assertObjectMatchAssert that an object contains matching properties.source
assertRejectsAssert that an async function rejects.source
assertStrictEqualsAssert that two values are strictly equal.source
assertStringIncludesAssert that a string contains another string.source
assertThrowsAssert that a synchronous function throws.source
failFail the current assertion immediately.source

Types

NameDescriptionSource
ErrorClassPublic API contract for error class.source

veryfront/testing/bdd

Portable BDD testing utilities (describe, it, beforeEach, afterEach). In Deno: Direct re-export from @std/testing/bdd (no wrapper) In Node.js: Uses node:test In Bun: Uses bun:test
import { afterAll, afterEach, beforeAll } from "veryfront/testing/bdd";

Functions

NameDescriptionSource
afterAllRegister a hook after all BDD tests in a group.source
afterEachRegister a hook after each BDD test.source
beforeAllRegister a hook before all BDD tests in a group.source
beforeEachRegister a hook before each BDD test.source
describeGroup related BDD tests.source
initBddInitialize the BDD test adapter.source
itDefine a BDD test case.source

Types

NameDescriptionSource
BddTestContextContext passed to hooks and tests (BDD-specific)source
HookFnHook functionsource
TestFnTest function that can be sync or asyncsource
TestOptionsTest options for Deno sanitizers (ignored in Node/Bun)source

Constants

NameDescriptionSource
testShared test value.source
User guides: