holepunchto / brittle

Brittle TAP test framework
Apache License 2.0
81 stars 9 forks source link

TAP ok but DOT and SPEC return 1 failed with test count !== plan: #28

Closed timcash closed 2 years ago

timcash commented 2 years ago

TAP output

    ok 20 - should be equald
# time=4190.529833ms
---------------|---------|----------|---------|---------|-------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------|---------|----------|---------|---------|-------------------
All files      |     100 |      100 |     100 |     100 |                   
 rover_wrap.js |     100 |      100 |     100 |     100 |                   
---------------|---------|----------|---------|---------|-------------------

DOT output


  49 passing (4s)
  1 failing

  1) test count !== plan:

      test count !== plan
      + expected - actual

      -0
      +3

․
․---------------|---------|----------|---------|---------|-------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------|---------|----------|---------|---------|-------------------
All files      |     100 |      100 |     100 |     100 |                   
 rover_wrap.js |     100 |      100 |     100 |     100 |                   

my tests look like this

import { getLatest } from './wrap.js'
import { test, configure } from 'brittle'

configure({ serial: true })
test('getLatest()', async (t) => {
  const data = await getLatest()
  isDataType(t, data)
})

function isDataType (t, data) {
  t.is(typeof data.metadata.id, 'number')
}
timcash commented 2 years ago

I'll continue investigating. Attempted with this style as well. Probably something simple I am overlooking.

test('one', async (t) => {
  t.end()
})