Prohibit Chai expect or should; prefer assert

This commit is contained in:
Evan Hahn
2022-01-19 13:19:08 -06:00
committed by GitHub
parent 885b4d4d2e
commit c1e3e87b99
5 changed files with 57 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as chai from 'chai';
import { assert as chaiAssert } from 'chai';
import { assert, strictAssert } from '../../util/assert';
@@ -12,7 +12,7 @@ describe('assert utilities', () => {
});
it("throws if the assertion fails, because we're in a test environment", () => {
chai.assert.throws(() => {
chaiAssert.throws(() => {
assert(false, 'foo bar');
}, 'foo bar');
});
@@ -24,7 +24,7 @@ describe('assert utilities', () => {
});
it('throws if the assertion fails', () => {
chai.assert.throws(() => {
chaiAssert.throws(() => {
strictAssert(false, 'foo bar');
}, 'foo bar');
});