Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
fix(deps): typescript 3.7.2 and others: @holvonix-open/release-config…
Browse files Browse the repository at this point in the history
…-js@1.0.12, @types/chai@4.2.4, @types/node@12.12.7, chokidar-cli@2.1.0, codecov@3.6.1, concurrently@5.0.0, fp-ts@2.1.2, husky@3.0.9, io-ts-types@0.5.2, mocha@6.2.2 (#81)
  • Loading branch information
holvonixAdvay authored Nov 12, 2019
1 parent b0195ba commit c603a80
Show file tree
Hide file tree
Showing 6 changed files with 902 additions and 717 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@
"seedrandom": "^3.0.1"
},
"devDependencies": {
"@holvonix-open/release-config-js": "^1.0.3",
"@types/chai": "^4.1.7",
"@holvonix-open/release-config-js": "^1.0.12",
"@types/chai": "^4.2.4",
"@types/mocha": "^5.2.5",
"@types/node": "^12.6.9",
"@types/node": "^12.12.7",
"chai": "^4.2.0",
"chokidar-cli": "^2.0.0",
"codecov": "^3.4.0",
"concurrently": "^4.1.1",
"fp-ts": "^2.0.4",
"chokidar-cli": "^2.1.0",
"codecov": "^3.6.1",
"concurrently": "^5.0.0",
"fp-ts": "^2.1.2",
"gts": "^1.1.0",
"husky": "^3.0.2",
"husky": "^3.0.9",
"io-ts": "^2.0.1",
"io-ts-types": "^0.5.0",
"mocha": "^6.2.0",
"io-ts-types": "^0.5.2",
"mocha": "^6.2.2",
"monocle-ts": "^2.0.0",
"nyc": "^14.1.1",
"ts-mocha": "^6.0.0",
"typescript": "~3.6.2"
"typescript": "~3.7.2"
},
"peerDependencies": {
"fp-ts": "^2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export function fuzzIntersection(
children: b.types,
func: (ctx, n, ...h) => {
let d = 0;
let ret: unknown = undefined;
let ret: object | undefined | null = undefined;
const r = rng(n);
do {
ret = undefined;
Expand Down
5 changes: 4 additions & 1 deletion src/extra-fuzzers/io-ts-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ export const fuzzers = [
'DateFromUnixTime'
),
fuzzerByName(pipeFuzzer(t.Int, IntFromString.encode), 'IntFromString'),
fuzzerByName(pipeFuzzer(t.string, x => `n${x}`), 'NonEmptyString'),
fuzzerByName(
pipeFuzzer(t.string, x => `n${x}`),
'NonEmptyString'
),
fuzzerByName(
pipeFuzzer(t.number, NumberFromString.encode),
'NumberFromString'
Expand Down
56 changes: 24 additions & 32 deletions test/test-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,9 @@ describe('registry', () => {
.exampleGenerator(b);
for (let i = 0; i < 100; i++) {
assert.ok(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length <= 3
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length <= 3
);
}
});
Expand All @@ -285,10 +284,9 @@ describe('registry', () => {
let ml = 0;
for (let i = 0; i < 100; i++) {
ml = Math.max(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length,
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length,
ml
);
}
Expand All @@ -302,10 +300,9 @@ describe('registry', () => {
const r = r0.exampleGenerator(b);
for (let i = 0; i < 100; i++) {
assert.ok(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length <= 3
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length <= 3
);
}
});
Expand All @@ -323,10 +320,9 @@ describe('registry', () => {
.exampleGenerator(b);
for (let i = 0; i < 100; i++) {
assert.ok(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length <= 3
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length <= 3
);
}
});
Expand All @@ -341,10 +337,9 @@ describe('registry', () => {
let ml = 0;
for (let i = 0; i < 100; i++) {
ml = Math.max(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length,
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length,
ml
);
}
Expand All @@ -358,10 +353,9 @@ describe('registry', () => {
const r = r0.exampleGenerator(b);
for (let i = 0; i < 100; i++) {
assert.ok(
Object.getOwnPropertyNames(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).length <= 3
Object.getOwnPropertyNames(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).length <= 3
);
}
});
Expand Down Expand Up @@ -481,10 +475,9 @@ describe('registry', () => {
.exampleGenerator(b);
const keys = new Set<string>();
for (let i = 0; i < 10; i++) {
Object.keys(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object).map(x => keys.add(x));
Object.keys(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
).map(x => keys.add(x));
}
assert.deepStrictEqual(keys.size, 2);
assert.ok(keys.has('a'));
Expand All @@ -504,10 +497,9 @@ describe('registry', () => {
.exampleGenerator(b);
const keys = new Set<string>();
for (let i = 0; i < 10; i++) {
const ek = Object.keys(r.encode([
i,
fuzzContext({ maxRecursionHint: 10 }),
]) as object);
const ek = Object.keys(
r.encode([i, fuzzContext({ maxRecursionHint: 10 })]) as object
);
assert.ok(ek.includes('a'));
assert.ok(ek.includes('j'));
ek.map(x => keys.add(x));
Expand Down
28 changes: 14 additions & 14 deletions test/tested-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ interface RecD2_MutualRecursionArray {
next: undefined | RecD1_MutualRecursionReadonlyArray;
}
// tslint:disable-next-line:variable-name
const RecD1_MutualRecursionReadonlyArray: t.Type<
RecD1_MutualRecursionReadonlyArray
> = t.recursion('RecD1_MutualRecursionReadonlyArray', () =>
t.type({
c1: t.union([t.number, RecD1_MutualRecursionReadonlyArray]),
next: t.readonlyArray(RecD2_MutualRecursionArray),
})
const RecD1_MutualRecursionReadonlyArray: t.Type<RecD1_MutualRecursionReadonlyArray> = t.recursion(
'RecD1_MutualRecursionReadonlyArray',
() =>
t.type({
c1: t.union([t.number, RecD1_MutualRecursionReadonlyArray]),
next: t.readonlyArray(RecD2_MutualRecursionArray),
})
);
// tslint:disable-next-line:variable-name
const RecD2_MutualRecursionArray: t.Type<
RecD2_MutualRecursionArray
> = t.recursion('RecD2_MutualRecursionArray', () =>
t.type({
c2: t.union([t.string, RecD2_MutualRecursionArray]),
next: t.union([t.undefined, RecD1_MutualRecursionReadonlyArray]),
})
const RecD2_MutualRecursionArray: t.Type<RecD2_MutualRecursionArray> = t.recursion(
'RecD2_MutualRecursionArray',
() =>
t.type({
c2: t.union([t.string, RecD2_MutualRecursionArray]),
next: t.union([t.undefined, RecD1_MutualRecursionReadonlyArray]),
})
);

// tslint:disable-next-line:class-name
Expand Down
Loading

0 comments on commit c603a80

Please sign in to comment.