Comments (5)
yup we can close this! 🥳
fixed by #1609
from chai.
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.
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 locallyif 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.
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.
@43081j is this fixed now after #1609?
from chai.
Related Issues (20)
- v5 - `Unknown file extension ".ts"` when running with mocha HOT 11
- mutating chai exports no longer works in v5 HOT 22
- Add support for Promise HOT 16
- SyntaxError: Invalid or unexpected token HOT 1
- [email protected] syntax error in assertion.js:69 HOT 2
- NPM README and GitHub README don't match
- @types/chai seems not to be adapted to version 5.0.0 HOT 9
- Documentation revamp HOT 3
- please provide commonjs exports again HOT 5
- Migrating to Chai 5.0 in browser
- use() function only returns plugin first time HOT 1
- TypeError: Unknown file extension ".ts" with Chai 5.0.0 and later HOT 2
- chai-spies broken in v5.1.0 HOT 1
- The plugin API makes me want to murder someone
- without "@types/chai" my IDE didn't recognize some attributes
- chai-subset is unmaitained HOT 7
- ChaiJS Website not showing API reference docs HOT 6
- Better user experience when using `.include` without `.deep`.
- Feature Request: a hook to preprocess values that crash Chai diff generation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chai.