GithubHelp home page GithubHelp logo

Comments (5)

43081j avatar 43081j commented on May 18, 2024 1

yup we can close this! 🥳

fixed by #1609

from chai.

43081j avatar 43081j commented on May 18, 2024

what are you expecting to happen?

the code does throw, so i'd expect no errors to occur and that's what im seeing when i try this locally

if you can give a little more info, might be able to help

from chai.

myocytebd avatar myocytebd commented on May 18, 2024

what are you expecting to happen?

the code does throw, so i'd expect no errors to occur and that's what im seeing when i try this locally

if you can give a little more info, might be able to help

I got assertion failures with node 18/20/21. (on code)

.../script.common/node_modules/chai/chai.js:1419
    throw new AssertionError(
    ^

AssertionError: expected [Function] to throw /bbb/ but Error: aaa.bbb was thrown
    at evalmachine.<anonymous>:2:13
    at Script.runInContext (node:vm:133:12)
    at Object.runInContext (node:vm:287:6)
    at Immediate.runTest (.../script.common/bbb.js:10:8) {
  actual: Error: aaa.bbb
      at evalmachine.<anonymous>:2:34
      at Proxy.assertThrows (.../script.common/node_modules/chai/chai.js:2668:5)
      at Proxy.methodWrapper (.../script.common/node_modules/chai/chai.js:1582:25)
      at assert.throws (.../script.common/node_modules/chai/chai.js:3451:71)
      at evalmachine.<anonymous>:2:13
      at Script.runInContext (node:vm:133:12)
      at Object.runInContext (node:vm:287:6)
      at Immediate.runTest (.../script.common/bbb.js:10:8),
  expected: /bbb/,
  showDiff: true,
  operator: 'strictEqual'
}

Here it doesn't look correct:
node_modules/chai/chai.js:2668:5 if (errorLike instanceof RegExp || typeof errorLike === "string") {
Built-in globals are per-JSContext and cannot be tested by instanceof.

from chai.

43081j avatar 43081j commented on May 18, 2024

ah i get you! i was missing the error matcher in my local test

you are correct. we should instead do Object.prototype.toString.call(errorLike) === '[object RegExp]'

from chai.

koddsson avatar koddsson commented on May 18, 2024

@43081j is this fixed now after #1609?

from chai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.