Skip to content

Commit 9d2d2a1

Browse files
committed
Changed the maxError default to 50 as it yields much better results when shrink integers
1 parent dc9ab23 commit 9d2d2a1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

documentation/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ return expect(function (text) {
188188
or setting the query parameter `maxiterations` in the browser.
189189
* `maxErrorIterations` (default 1000): the number of iterations unexpected-check
190190
can use to find a better error when an error occurs.
191-
* `maxErrors` (default 20): the number of found errors before stopping the input
191+
* `maxErrors` (default 50): the number of found errors before stopping the input
192192
shrinking process.
193193

194194
```js

lib/unexpected-check.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
var generators = options.generators || [];
106106
var maxIterations = options.maxIterations || defaultMaxIterations;
107107
var maxErrorIterations = options.maxErrorIterations || 1000;
108-
var maxErrors = options.maxErrors || 20;
108+
var maxErrors = options.maxErrors || 50;
109109

110110
function createTask() {
111111
var args = generators.map(function (g) {

test/unexpected-check.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('unexpected-check', function () {
6060
expect(arr, 'not to contain', 2);
6161
}, 'to be valid for all', arrays);
6262
}, 'to throw',
63-
'Ran 62 iterations and found 20 errors\n' +
63+
'Ran 154 iterations and found 50 errors\n' +
6464
'counterexample:\n' +
6565
'\n' +
6666
' Generated input: [ 2 ]\n' +
@@ -133,7 +133,7 @@ describe('unexpected-check', function () {
133133
});
134134
}, 'to be valid for all', arrays);
135135
}, 'to throw',
136-
'Ran 64 iterations and found 20 errors\n' +
136+
'Ran 119 iterations and found 50 errors\n' +
137137
'counterexample:\n' +
138138
'\n' +
139139
' Generated input: [ \')\' ]\n' +

0 commit comments

Comments
 (0)