std/internal/assertion_state_test.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

29 lines
972 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "@std/assert";
import { AssertionState } from "./assertion_state.ts";
Deno.test("AssertionState checkAssertionErrorState pass", () => {
const assertionState = new AssertionState();
assertionState.setAssertionTriggered(true);
assertEquals(assertionState.checkAssertionErrorState(), false);
});
Deno.test("AssertionState checkAssertionErrorState pass", () => {
const assertionState = new AssertionState();
assertionState.setAssertionTriggered(true);
assertEquals(assertionState.checkAssertionErrorState(), false);
assertionState.setAssertionCheck(true);
assertEquals(assertionState.checkAssertionErrorState(), false);
});
Deno.test("AssertionState checkAssertionErrorState fail", () => {
const assertionState = new AssertionState();
assertionState.setAssertionCheck(true);
assertEquals(assertionState.checkAssertionErrorState(), true);
});