question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

embracing proxies

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
meebercommented, Sep 7, 2016

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.

1reaction
meebercommented, Sep 7, 2016

@yairper I suspect it’s possible to write a normal plugin (http://chaijs.com/guide/plugins/) that implements the desired behavior by replacing be and have with custom logic. Adding chai-plugin keyword to the plugin’s package.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?

Read more comments on GitHub >

github_iconTop 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 >
proxy
A collection of 1 post · Always Implement These 4 Methods When Proxying in iOS.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found