Skip to content

Commit

Permalink
guard against multiple registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed May 16, 2024
1 parent 0bf21dd commit cb42b01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/chai-as-promised.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import * as checkErrorDefault from 'check-error';

let alreadySetUp = false;
let checkError = checkErrorDefault;

export default function (chai, utils) {
if (alreadySetUp) return;
alreadySetUp = true;

const Assertion = chai.Assertion;
const assert = chai.assert;
const proxify = utils.proxify;
Expand Down

0 comments on commit cb42b01

Please sign in to comment.