Skip to content

Commit

Permalink
fixup into prop_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Jul 8, 2024
1 parent 256ae6b commit 3724f23
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Agent } from '@dfinity/agent';
import { deepEqual, getActor, Named } from 'azle/property_tests';
import { getActor, Named } from 'azle/property_tests';
import { CandidReturnType } from 'azle/property_tests/arbitraries/candid/candid_return_type_arb';
import { CandidValueAndMeta } from 'azle/property_tests/arbitraries/candid/candid_value_and_meta_arb';
import { CorrespondingJSType } from 'azle/property_tests/arbitraries/candid/corresponding_js_type';
Expand Down Expand Up @@ -48,7 +48,7 @@ function generateTest(
const result = await actor[functionName](...paramValues);

if (behavior === 'ACCEPT') {
return { Ok: deepEqual(result, expectedResult) };
return testEquality(result, expectedResult);
}

return {
Expand All @@ -64,9 +64,10 @@ function generateTest(

if (behavior === 'THROW') {
const expectedError = `Method \\"${functionName}\\" not allowed`;
return {
Ok: error.message.includes(expectedError)
};
return testEquality(
error.message.includes(expectedError),
true
);
}

throw error;
Expand Down

0 comments on commit 3724f23

Please sign in to comment.