Testing with Fast Check

ok sorry for the dumb questions. how would i test this using fast check?

const UnixTime = Schema.Number.pipe(
  Schema.int(),
  Schema.nonNegative(),
  Schema.brand('UnixTime'),
);

const UnixTimeToDate = Schema.compose(
  Schema.transformOrFail(UnixTime, Schema.Number, {
    decode: (n) => ParseResult.succeed(n * 1000),
    encode: (n) =>
      Schema.decode(UnixTime)(Math.floor(n / 1000)).pipe(
        Effect.mapError((e) => e.error),
      ),
  }),
  Schema.DateFromNumber,
);
Was this page helpful?