Skip to content

Commit

Permalink
fix ua asserts issue without tap
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanto committed Nov 11, 2024
1 parent 436b326 commit 71dd46c
Show file tree
Hide file tree
Showing 2 changed files with 256 additions and 217 deletions.
10 changes: 9 additions & 1 deletion src/user-agent/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ export class TestUserAgent extends MockUserAgent {
* Delegate assertion to test framework currently in use.
*/
assert(name: string, args: any[], msg: string, skip: SkipFunction): void {
const test: any = this._assert ?? assert;
const test: any = this._assert ?? {
equal: assert.strictEqual,
not: assert.notStrictEqual,
match: assert.match,
notMatch: assert.doesNotMatch,
ok: assert.ok,
notOk: (value: any, message: string) => assert.ok(!value, message),
same: assert.deepStrictEqual
};
test[name](...args, msg, {stack: this._stack.captureString(10, skip).replaceAll('file://', '')});
}

Expand Down
Loading

0 comments on commit 71dd46c

Please sign in to comment.