All files / testing / _testing / deno.ts

100.00% Branches 0/0
100.00% Lines 16/16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
x43
 
 
x43
x395
x395
x1975
x43
x43
x220
x43
x43
x225
x43
x43
x220
x44
x43

















// Imports
import type { options, Promisable, runner } from "./common.ts"
import { format } from "./common.ts"

/** Deno test runner. */
export const test = Object.assign(function (name: string, fn: () => Promisable<void>, options?: options) {
  options ??= {}
  options.permissions ??= "none"
  return globalThis.Deno.test({ name: format(name), fn, ...options })
}, {
  only: function (name: string, fn: () => Promisable<void>, options?: options) {
    return globalThis.Deno.test.only({ name: format(name), fn, ...options })
  },
  skip: function (name: string, fn: () => Promisable<void>, options?: options) {
    return globalThis.Deno.test.ignore({ name: format(name), fn, ...options })
  },
  todo: function (name: string, fn: () => Promisable<void>, options?: options) {
    return globalThis.Deno.test.ignore({ name: format(name), fn, ...options })
  },
}) as runner