Skip to content

Commit

Permalink
fix: remove assert from callback
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Sep 1, 2023
1 parent e83db2b commit 4a8c22f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions mocks/tops/test2.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { suite } from '../../src/taps/index.js'
import { suite, test } from '../../src/taps/index.js'

Check failure on line 1 in mocks/tops/test2.test.js

View workflow job for this annotation

GitHub Actions / Linux

'suite' is declared but its value is never read.

Check failure on line 1 in mocks/tops/test2.test.js

View workflow job for this annotation

GitHub Actions / Win

'suite' is declared but its value is never read.

Check failure on line 1 in mocks/tops/test2.test.js

View workflow job for this annotation

GitHub Actions / Mac

'suite' is declared but its value is never read.
import { type, is } from 'uvu/assert'

const { test } = suite('suite1')

test('sum suite 1', () => {
type(() => {}, 'function')
is(3, 3)
})

test('sum suite 3', (t) => {
t('sum suite 3.1', () => {
is(3, 3)
})
})
3 changes: 1 addition & 2 deletions src/taps/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/* eslint-disable no-console */
import kleur from 'kleur'
import { hrtime, stack } from './utils.js'
import { assert } from './assert.js'

/**
* @type {import("./types.js").Queue}
Expand Down Expand Up @@ -129,7 +128,7 @@ async function runner(ctx, testCount) {
throw new Error('beforeEach hook failed', { cause: error })
}
}
await test.fn(harness(test.name), assert)
await test.fn(harness(test.name))
passed++

// After Each Hooks
Expand Down
2 changes: 1 addition & 1 deletion src/taps/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface Assert {
subset: typeof subset
}

export type Fn = (test: Harness, a: Assert) => Promise<void> | void
export type Fn = (test: Harness) => Promise<void> | void
export type Hook = () => Promise<void> | void
export type TestMethod = (name: string, fn: Fn) => void
export type HookMethod = (fn: Hook) => void
Expand Down

0 comments on commit 4a8c22f

Please sign in to comment.