Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"semi": [
2,
"always"
]
],
"immutable/no-let": 2,
"immutable/no-this": 2,
"immutable/no-mutation": 2
},
"env": {
"browser": true,
Expand All @@ -20,6 +23,9 @@
"extends": [
"standard"
],
"plugins": [
"immutable"
],
"globals": {
"window": true,
"describe": true,
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: node_js
node_js:
- "7"
dist: trusty
sudo: false
sudo: required
addons:
chrome: stable
before_install:
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,45 @@ Note, that objects and arrays need to be stringified first:
`
);

# Null and undefined values

To test for undefined null and undefined values, use the following syntax. This is because there is an error check to see
if all required values have been passed and values of null and undefined defeat that test. A replacement value is used to state
the intention but the actual value of null or undefined will be passed to the test.

```
unroll('should be okay with id being #id', (done, testArgs) => {
let object = { id: testArgs.id };
expect(object.id).toEqual(testArgs.id);
done();
},
`
where:
id
${Symbol.keyFor(unroll.NULL)}
${Symbol.keyFor(unroll.UNDEFINED)}
`
);
and the array notation:

unroll('should be okay with id being #id', (done, testArgs) => {
let object = { id: testArgs.id };
expect(object.id).toEqual(testArgs.id);
done();
},
[
['id']
[null],
[undefined],
[Unroll.NULL],
[Unroll.UNDEFINED],
]


```

make

## Examples

The following example is the same shown in examples/mocha-bdd-example.js file. It can be run using Mocha eg:
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-disable-next-line immutable/no-mutation
module.exports = require('./lib/unroll');
Loading