lorenzofox3 / zora-node

test runner for nodejs using zora testing library
MIT License
27 stars 3 forks source link

Failing 'throws' assertion not properly reported #8

Open christopheraue opened 4 years ago

christopheraue commented 4 years ago

Instead of showing the reason for the failing assertion (e.g. a message mismatch) it shows (unknown operator: throws)

Test file:

// error.js
export default ({test}) => {
  test('failing throws assertion', t => {
    t.throws(() => { throw new Error('message') }, /another message/)
  })
}

Output:

$ yarn pta error.js 
yarn run v1.21.1
$ /mnt/shared/projects/node_modules/lgt/node_modules/.bin/pta error.js

 TESTS FILES

  ✖    0/1  /error.js

 FAILURES

1. failing throws assertion > should throw <-- [ throws ]
    at /mnt/shared/projects/node_modules/lgt/error.js:3:7

    (unknown operator: throws)
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________

 SUMMARY

 ✔ PASS: 0
 ⚠ SKIP: 0
 ✔ FAIL: 1

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.