test-data-bot
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -1,6 +0,10 @@ | ||
### 0.6.0 [03 August] | ||
### 0.6.1 [01 Dec] 2018 | ||
- fix bug that meant overriding a boolean to always be `false` wouldn't happen (https://github.com/jackfranklin/test-data-bot/issues/6) | ||
### 0.6.0 [03 August] 2018 | ||
- rebuilt to enable fully nested builders | ||
### 0.5.0 [03 August] | ||
### 0.5.0 [03 August] 2018 | ||
@@ -11,16 +15,16 @@ - add `arrayOf` | ||
### 0.4.0 [19 July] | ||
### 0.4.0 [19 July] 2018 | ||
- add `oneOf` and `incrementingId` | ||
### 0.3.0 [13 June] | ||
### 0.3.0 [13 June] 2018 | ||
- Fix `main` in `package.json` not pointing in the right place [PR by Kent C. Dodds](https://github.com/jackfranklin/test-data-bot/pull/1) | ||
### 0.2.0 [12 June] | ||
### 0.2.0 [12 June] 2018 | ||
- Added `perBuild` generator. | ||
### 0.1.0 [11 June] | ||
### 0.1.0 [11 June] 2018 | ||
- First release! |
{ | ||
"name": "test-data-bot", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Generate test data for your tests easily.", | ||
@@ -22,3 +22,3 @@ "engines": { | ||
"eslint": "4.19.1", | ||
"eslint-config-prettier": "2.9.0", | ||
"eslint-config-prettier": "3.3.0", | ||
"eslint-config-unobtrusive": "1.2.2", | ||
@@ -28,3 +28,3 @@ "eslint-plugin-jest": "21.17.0", | ||
"jest": "23.1.0", | ||
"prettier": "1.13.5" | ||
"prettier": "1.15.3" | ||
}, | ||
@@ -31,0 +31,0 @@ "dependencies": { |
@@ -26,3 +26,5 @@ const Generator = require('./generator') | ||
return Object.assign({}, resultingObject, { | ||
[this._name]: overrides[this._name] || this.generateValue(), | ||
[this._name]: overrides.hasOwnProperty(this._name) | ||
? overrides[this._name] | ||
: this.generateValue(), | ||
}) | ||
@@ -29,0 +31,0 @@ } |
@@ -243,2 +243,15 @@ const { | ||
}) | ||
it('lets a random boolean be overriden to be false', () => { | ||
const userBuilder = build('User').fields({ | ||
admin: bool(), | ||
}) | ||
// this test is sometimes true, the bug that lead to this test | ||
// was that the `false` would be ignored and the value would still be random | ||
// so we run this 10 times to get around the randomness of the failure | ||
Array.from({ length: 10 }).map(_ => { | ||
const user = userBuilder({ admin: false }) | ||
expect(user.admin).toEqual(false) | ||
}) | ||
}) | ||
}) |
176960
10
382