Skip to content

Commit

Permalink
Simplify utest 'Should generate an object'
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Jan 29, 2018
1 parent 6adf6f2 commit ba10b9c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/unit/check/arbitrary/ObjectArbitrary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,9 @@ describe("ObjectArbitrary", () => {
});
describe('object', () => {
it('Should generate an object', () => fc.assert(
fc.property(fc.integer(),
fc.string(), fc.array(fc.string()),
fc.string(), fc.array(fc.string()), (seed, key0, keys, value0, values) => {
const allowedKeys = [key0, ...keys];
const allowedValues = [value0, ...values];
fc.property(fc.integer(), (seed) => {
const mrng = stubRng.mutable.fastincrease(seed);

const keyArb = oneof(constant(key0), ...keys.map(constant));
const baseArbs = [...allowedValues.map(constant)];
const g = object({key: keyArb, values: baseArbs}).generate(mrng).value;

const g = object().generate(mrng).value;
return typeof g === 'object' && ! Array.isArray(g);
})
));
Expand Down

0 comments on commit ba10b9c

Please sign in to comment.