This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
works-on-my-machine/tests/it.test.ts
Marc Cataford 2bc6d94507
feat: each support (#13)
* feat: add each support for test, describe

* docs: document test

* feat: label templating basic support

* refactor: group test exports together

* refactor: leverage each in repetitive tests

* chore: pinned node -> alias

* test: coverage for it, test
2023-04-14 09:38:22 -04:00

14 lines
411 B
TypeScript

import assert from 'assert'
import { it, test, expect, describe } from '../src'
describe.each([it, test])('Runs tests', (fn: unknown) => {
const testFn = fn as typeof test
testFn('Runs a test', () => {
assert.doesNotThrow(() => expect(1).toEqual(1))
})
testFn.each([1, 2, 3])('Supports parametrization (value=%s)', (value: unknown) => {
assert.doesNotThrow(() => expect(value).toEqual(value))
})
})