embracing proxies
See original GitHub issueHi,
We could start enjoying the power of proxies to create even better DSL. Examples:
let element = { visible: true }
element.should.be.visible
let element = { isVisible: true }
element.should.be.visible
let response = { status: 200 }
response.should.have.status(200)
WDYT?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Wotc's response to people embracing proxies: destroy the ...
Wotc's response to people embracing proxies: destroy the community, starting with cardconjurer. So, if you haven't heard, CardConjurer, ...
Read more >What Are Proxies For? 8 Important Reasons To Use Proxies
Thanks to today's article, you will understand: proxies can be useful for almost everyone, in different situations. Proxy connection benefits.
Read more >Conservatives Embrace 'Anti-Woke' Proxy Votes to Blunt ESG
Now conservative groups are getting into the game, led by two little-known strategists who have mastered the art of the proxy ballot.
Read more >Magic The Gathering Players Are So Wrong About Proxies
Proxies make Magic a more vibrant game, yet some people really don't ... though, because Wizards itself has begun embracing proxies.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My first impression is that it sounds cool in theory but in practice it opens the door too wide for mistakes and unexpected behavior without adding enough benefit over
.property(name, value)
. As discussed in #726, one of our central focuses is making it difficult for developers to accidentally write tests that look and act as if they’re correct but actually silently aren’t.I think enabling cool shortcuts like
.be.visible
is better served via domain-specific plugins as opposed to enabled via a proxy-based catch-all.@yairper I suspect it’s possible to write a normal plugin (http://chaijs.com/guide/plugins/) that implements the desired behavior by replacing
be
andhave
with custom logic. Addingchai-plugin
keyword to the plugin’spackage.json
would cause it to be added to the website list.If it turns out there’s really no way to implement this behavior through the plugin system and forking Chai is the only option, then I’m not sure what the best way to advertise it is. @keithamus @lucasfcosta?