Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Weatherford authored and Stephen Weatherford committed Aug 18, 2023
1 parent ff84414 commit 37ba7a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/fixed_assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { isWebpack } from "../common";

export const breakOnAssert: boolean = /^(true|1)$/i.test(process.env.BREAK_ON_ASSERT ?? '');

export function disableBreakOnAssert(value: boolean): void {
process.env.DISABLE_BREAK_ON_ASSERT = value ? 'true' : '';
}

function fixed_ok(value: unknown, message?: string): void {
// eslint-disable-next-line no-extra-boolean-cast
if (!!value) {
Expand Down
5 changes: 2 additions & 3 deletions test/support/testWithoutBreakOnAssert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

import { Context, Test } from "mocha";
// eslint-disable-next-line no-restricted-imports
import { disableBreakOnAssert } from "../../src/fixed_assert";
import { ITestPreparation, ITestPreparationResult, testWithPrep } from "./testWithPrep";

export class WithoutBreakOnAssertPrep implements ITestPreparation {
public static readonly instance: WithoutBreakOnAssertPrep = new WithoutBreakOnAssertPrep();

public pretest(this: Mocha.Context): ITestPreparationResult {
disableBreakOnAssert(true);
process.env.DISABLE_BREAK_ON_ASSERT = 'true';
return {
postTestActions: () => disableBreakOnAssert(false)
postTestActions: () => process.env.DISABLE_BREAK_ON_ASSERT = ''
};
}
}
Expand Down

0 comments on commit 37ba7a5

Please sign in to comment.