Skip to content

Commit

Permalink
shorten service
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Sep 11, 2024
1 parent fc1384d commit f42e3c6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/property/candid_rpc/class_api/service/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { defaultArrayConstraints, runPropTests } from 'azle/test/property';
import {
defaultArrayConstraints,
runPropTests,
shortArrayConstraints
} from 'azle/test/property';
import { ServiceArb } from 'azle/test/property/arbitraries/candid/reference/service_arb';
import {
CanisterArb,
Expand Down Expand Up @@ -29,11 +33,17 @@ const AllServicesQueryMethodArb = QueryMethodArb(
ServiceArb(context)
);

const arrayConstraints =
process.env.AZLE_TEST_RUN_ON_RELEASE === 'true' ||
process.env.AZLE_TEST_RUN_ON_LOCAL === 'true'
? {
...defaultArrayConstraints,
maxLength: 30 // If the number of generated services is too large we will run out of space in the wasm custom section.
}
: shortArrayConstraints;

const CanisterConfigArb = fc
.array(AllServicesQueryMethodArb, {
...defaultArrayConstraints,
maxLength: 30 // If the number of generated services is too large we will run out of space in the wasm custom section.
})
.array(AllServicesQueryMethodArb, arrayConstraints)
.map((queryMethods): CanisterConfig => {
return { queryMethods };
});
Expand Down

0 comments on commit f42e3c6

Please sign in to comment.