Comments (1)
I personally find:
assume('foo').is.either('bar', 'foo', 'banana');
Easier to read and write than:
assume('foo').is.either(['foo, 'bar', 'baz]);
As the example above could also mean that it should be an array instead of one of the strings that are present in the array. Especially when you start doing deep
equals of array using either:
assume(['foo']).is.deep.either([['bar'], ['foo'], 'bar']);
assume(['foo']).is.deep.either(['bar'], ['foo'], 'bar');
But I do understand you point and this API is less than ideal. And I don't really an other option forcing an array structure if we want all API methods to follow the same argument structure.
As for the somewhat "private" slice argument, it has been removed from the eql
method now that I introduced a sliceStack
option in #3.
from assume.
Related Issues (14)
- Is `Assert.add` part of the public interface? HOT 5
- [feature request] assume(new Promise(...)).throws(); HOT 4
- Add .expected and .actual properties to Errors HOT 2
- `assume.wait` but immediately calls `next` on failure
- Dependencies gone: `is-node` and `prettify-error` HOT 7
- Update npm package HOT 2
- Add the ability to manually pass in source files HOT 1
- Add the ability to extend functionality of existing methods
- `string(thing)` can cause unwanted output in terminals HOT 1
- Is it possible to log some contextual information when an assertion fails? HOT 1
- increment `slice` when cloned? HOT 5
- Add support for various of ES6 introduced methods. HOT 1
- Object thrown in NodeJS HOT 3
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 assume.