Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 20, 2023
1 parent f404192 commit 8795a5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jobs:
"examples/update",
"examples/vanilla_js",
"property_tests/tests/blob",
"property_tests/tests/boolean",
"property_tests/tests/int",
"property_tests/tests/int8",
"property_tests/tests/int16",
Expand Down
Empty file.
8 changes: 3 additions & 5 deletions property_tests/tests/bool/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ const BoolTestArb = fc
const returnCandidType = 'bool';
const paramNames = bools.map((_, index) => `param${index}`);

const paramsAreNumbers = paramNames
const paramsAreBooleans = paramNames
.map((paramName) => {
return `if (typeof ${paramName} !== 'boolean') throw new Error('${paramName} must be a boolean');`;
})
.join('\n');

const paramsAnd = paramNames.reduce((acc, paramName) => {
const returnStatement = paramNames.reduce((acc, paramName) => {
return `${acc} && ${paramName}`;
}, 'true');

const returnStatement = `${paramsAnd}`;

const expectedResult = bools.reduce((acc, bool) => acc && bool, true);

const paramSamples = bools;
Expand All @@ -43,7 +41,7 @@ const BoolTestArb = fc
body: `
${paramsCorrectlyOrdered}
${paramsAreNumbers}
${paramsAreBooleans}
return ${returnStatement};
`,
Expand Down

0 comments on commit 8795a5a

Please sign in to comment.