Comments (5)
One thing to note is that keys
behaves differently depending on the modifier..
expect({ foo: 1, bar: 2 }).to.have.keys('foo', 'bar'); // this is strict; all or nothing
expect({ foo: 1, bar: 2 }).to.contain.keys('foo'); // this is inclusion
This is achieved through this.contains
, which can be seen triggered here and used here.
Provided that the strict/inclusion feature for keys is not lost, I have no objections. Also, if you would be so kind to include some tests, that would be awesome :)
from chai.
I fixed the small typos for the docs.
Is the second part, the feature request, something that you have had a chance to look into? It not, I'll slate it for 0.4.x.
from chai.
I ended up using similar ideas in chai-jquery, but haven't had time to do it for chai itself. Feel free to put it on the back burner.
from chai.
i like the idea so im going to leave this open so it doesn't fall into the abyss of closed tickets
from chai.
This has been implemented in the 0.6.x branch and will be in the next release :)
/cc @vesln
from chai.
Related Issues (20)
- chai.version field is incorrect HOT 8
- Potential Security Vulnerabilities Detected in Package
- Mention existence of `5.x.x` branch and `v5.0.0-alpha.0` in README HOT 2
- `chai.should()` break error reporting in `node:test` on node `18.17.0`
- 5.0.0-alpha.1 was published as "latest" npm dist-tag HOT 2
- strictEqual / deepStrictEqual behave differently on numbers
- Vulnerability in chai Module HOT 2
- Fix get-func-name HOT 3
- Update dependency on `get-func-name` to at least 2.0.1 to fix CVE HOT 5
- Buffer is not recognized as an object HOT 1
- Officia type definitions for 5.x? HOT 6
- Package subpath './register-should' is not defined by "exports" in node_modules/chai/package.json for node 18.14.0 HOT 1
- ERR_REQUIRE_ESM in v5 HOT 41
- v5 vs chai-as-promised HOT 1
- [v5] `assert.isFunction()` fails with async function HOT 4
- 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 9
- SyntaxError: Invalid or unexpected token HOT 1
- [email protected] syntax error in assertion.js:69 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.