Skip to content

Commit b82344b

Browse files
authored
Prevent RDF tests running with invalid dates (#2679)
1 parent 7ff2b4c commit b82344b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/datatypes.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import type { LocalNode } from "./interfaces";
4848
import { localNodeSkolemPrefix } from "./rdf.internal";
4949

5050
describe("stress-testing serialisations", () => {
51-
it("should always return the input value when serialising, then deserialing a boolean", () => {
51+
it("should always return the input value when serializing, then deserializing a boolean", () => {
5252
const runs = 100;
5353
expect.assertions(runs + 2);
5454

@@ -65,12 +65,12 @@ describe("stress-testing serialisations", () => {
6565
expect(fcResult.failed).toBe(false);
6666
});
6767

68-
it("should always return the input value when serialising, then deserialing a datetime", () => {
68+
it("should always return the input value when serializing, then deserializing a datetime", () => {
6969
const runs = 100;
7070
expect.assertions(runs + 2);
7171

7272
const fcResult = fc.check(
73-
fc.property(fc.date(), (inputDatetime) => {
73+
fc.property(fc.date({ noInvalidDate: true }), (inputDatetime) => {
7474
expect(
7575
deserializeDatetime(serializeDatetime(inputDatetime))?.getTime(),
7676
).toBe(inputDatetime.getTime());
@@ -82,11 +82,11 @@ describe("stress-testing serialisations", () => {
8282
expect(fcResult.failed).toBe(false);
8383
});
8484

85-
it("should always return the input value when serialising -0, then deserialing to 0", () => {
85+
it("should always return the input value when serializing -0, then deserializing to 0", () => {
8686
expect(deserializeDecimal(serializeDecimal(-0))).toBe(0);
8787
});
8888

89-
it("should always return the input value when serialising, then deserialing a decimal", () => {
89+
it("should always return the input value when serializing, then deserializing a decimal", () => {
9090
const runs = 100;
9191
expect.assertions(runs + 2);
9292

@@ -103,7 +103,7 @@ describe("stress-testing serialisations", () => {
103103
expect(fcResult.failed).toBe(false);
104104
});
105105

106-
it("should always return the input value when serialising, then deserialing a integer", () => {
106+
it("should always return the input value when serializing, then deserializing a integer", () => {
107107
const runs = 100;
108108
expect.assertions(runs + 2);
109109

src/rdf.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("fromRdfJsDataset", () => {
6060
DF.literal(serializeDecimal(value), DF.namedNode(xmlSchemaTypes.decimal)),
6161
);
6262
const fcDatetime = fc
63-
.date()
63+
.date({ noInvalidDate: true })
6464
.map((value) =>
6565
DF.literal(
6666
serializeDatetime(value),
@@ -690,7 +690,7 @@ describe("toRdfJsDataset", () => {
690690
})),
691691
});
692692

693-
it("loses no data when serialising and deserialising to RDF/JS Datasets", () => {
693+
it("loses no data when serializing and deserializing to RDF/JS Datasets", () => {
694694
const runs = process.env.CI ? 100 : 1;
695695
expect.assertions(runs + 2);
696696

0 commit comments

Comments
 (0)