-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for chai v5 #54
Comments
I started looking into this, the main problem right now is that we cannot monkey-patch the utils object anymore, since it is a non-configurable getter, so in chai v5 this will throw. |
Happy to make getters configurable in chai. Please file an issue with the explanation on the chai issue tracker so we can track the work there (or better yet, please file a PR 😉). |
I just looked into it. These getters are not produced by chai's own code, but by the var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// (disabled):util
var require_util = __commonJS({
"(disabled):util"() {
}
});
// lib/chai/utils/index.js
var utils_exports = {};
__export(utils_exports, {
addChainableMethod: () => addChainableMethod,
addLengthGuard: () => addLengthGuard,
addMethod: () => addMethod,
addProperty: () => addProperty,
checkError: () => check_error_exports,
compareByInspect: () => compareByInspect,
eql: () => deep_eql_default,
expectTypes: () => expectTypes,
flag: () => flag,
getActual: () => getActual,
getMessage: () => getMessage2,
getName: () => getName,
getOperator: () => getOperator,
getOwnEnumerableProperties: () => getOwnEnumerableProperties,
getOwnEnumerablePropertySymbols: () => getOwnEnumerablePropertySymbols,
getPathInfo: () => getPathInfo,
hasProperty: () => hasProperty,
inspect: () => inspect2,
isNaN: () => isNaN2,
isProxyEnabled: () => isProxyEnabled,
isRegExp: () => isRegExp2,
objDisplay: () => objDisplay,
overwriteChainableMethod: () => overwriteChainableMethod,
overwriteMethod: () => overwriteMethod,
overwriteProperty: () => overwriteProperty,
proxify: () => proxify,
test: () => test,
transferFlags: () => transferFlags,
type: () => type
}); |
We could also look into providing hooks into this to allow plugins like this one to do what it does, perhaps an |
Yes I was thinking about this too. It would need to cover these hooks: Lines 168 to 214 in bb5d007
|
node v18.19.0
npm v10.2.3
Current peerDependency doesn't include chai v5:
dirty-chai/package.json
Lines 39 to 41 in bb5d007
npm install fails because of that.
Does anything else need chaning in the code. I didn't test yet myself.
The text was updated successfully, but these errors were encountered: