All files / expect / _assertions.ts

100.00% Branches 0/0
100.00% Functions 3/3
100.00% Lines 12/12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
 
x105
 
x105
 
x105
x6
x6
 
x105
x8
x8
 
x105
x512
x512
x512
















// Copyright 2018-2026 the Deno authors. MIT license.

import { getAssertionState } from "@std/internal/assertion-state";

const assertionState = getAssertionState();

export function hasAssertions() {
  assertionState.setAssertionCheck(true);
}

export function assertions(num: number) {
  assertionState.setAssertionCount(num);
}

export function emitAssertionTrigger() {
  assertionState.setAssertionTriggered(true);
  assertionState.updateAssertionTriggerCount();
}