std/expect/_assertions.ts
eryue0220 ed79df4696
fix(expect,internal,testing): support expect.assertions (#6032)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-10-25 17:29:40 +09:00

19 lines
491 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. 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();
}