tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

Adapt test to V8 9.3 #562

Closed targos closed 2 years ago

targos commented 2 years ago

There is one test that will fail with Node.js >= 16.9.0, because V8 changed an error message:

https://github.com/substack/tape/blob/5a5a574d7b07c2c1bebda1c8cb74af9d906d178b/test/async-await.js#L265-L285

See https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/2754/nodes=fedora-latest-x64/testReport/junit/(root)/citgm/tape_v5_3_1/

     # Subtest: async-bug
         not ok 1 - should be equivalent
           ---
           found:
             - TAP version 13
             - '# async-error'
             - ok 1 before throw
             - ok 2 should be strictly equal
             - 'not ok 3 TypeError: Cannot read properties of null (reading ''length'')'
             - '  ---'
             - '    operator: error'
             - '    stack: |-'
             - '      TypeError: Cannot read properties of null (reading ''length'')'
             - '          at myCode ($TEST/async-await/async-bug.js:$LINE:$COL)'
             - '          at Test.myTest ($TEST/async-await/async-bug.js:$LINE:$COL)'
             - '  ...'
             - ''
             - 1..3
             - '# tests 3'
             - '# pass  2'
             - '# fail  1'
             - ''
             - ''
           wanted:
             - TAP version 13
             - '# async-error'
             - ok 1 before throw
             - ok 2 should be strictly equal
             - 'not ok 3 TypeError: Cannot read property ''length'' of null'
             - '  ---'
             - '    operator: error'
             - '    stack: |-'
             - '      TypeError: Cannot read property ''length'' of null'
             - '          at myCode ($TEST/async-await/async-bug.js:$LINE:$COL)'
             - '          at Test.myTest ($TEST/async-await/async-bug.js:$LINE:$COL)'
             - '  ...'
             - ''
             - 1..3
             - '# tests 3'
             - '# pass  2'
             - '# fail  1'
             - ''
             - ''
           at:
             line: 265
             column: 11
             file: test/async-await.js
           stack: |
             test/async-await.js:265:11
             ChildProcess.<anonymous> (test/common.js:102:9)
             ChildProcess.emit (node:events:394:28)
             Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
           source: |
             t.same(stripFullStack(stdout), [
           ...
ljharb commented 2 years ago

(-‸ლ) this isn't even a better error message