Skip to content

When assertion count is incorrect, output the expected and actual values. #102

@dylang

Description

@dylang

I see that the actual count is recorded, but I'm not sure how to see it when running ava.

https://github.com/sindresorhus/ava/blob/master/lib/test.js#L150-L158

❯ npm test

> npm-check@4.1.2 test /Users/dgreene/projects/npm-check
> xo && ava ./test


  ✖ require Assertion count does not match planned

  1 test failed

  1. require
  Error
    at Test.plan (/Users/dgreene/projects/npm-check/node_modules/ava/lib/test.js:87:19)
    at Test.<anonymous> (/Users/dgreene/projects/npm-check/test/test.js:10:7)
    at step (/Users/dgreene/projects/npm-check/test/test.js:5:273)
    at Test.fn (/Users/dgreene/projects/npm-check/test/test.js:5:99)

The above is using using master with power-assert added.

Similar output using the published version

> npm-check@4.1.2 test /Users/dgreene/projects/npm-check
> xo && ava ./test


  ✖ require Assertion count does not match planned

  1 test failed

  1. require
  Error
    at Test.plan (/Users/dgreene/projects/npm-check/node_modules/ava/lib/test.js:59:19)
    at Object.callee$0$0$ (/Users/dgreene/projects/npm-check/test/test.js:10:7)
    at Test.callee$0$0 [as fn] (/Users/dgreene/projects/npm-check/test/test.js:32:26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredhelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions