Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Failing 'throws' assertion not properly reported #8

Open
christopheraue opened this issue Feb 2, 2020 · 0 comments
Open

Failing 'throws' assertion not properly reported #8

christopheraue opened this issue Feb 2, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@christopheraue
Copy link

christopheraue commented Feb 2, 2020

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.
@lorenzofox3 lorenzofox3 added the bug Something isn't working label Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants