Skip to content

Commit 325e34e

Browse files
committed
update imports and tests
1 parent 48e4f03 commit 325e34e

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

.yarn/install-state.gz

1.99 KB
Binary file not shown.

lib/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { safePointerToPath, stripHash, getHash } from "./util/url.js";
55
import type $Refs from "./refs.js";
66
import type $RefParserOptions from "./options.js";
77

8-
type $RefError = JSONParserError | ResolverError | ParserError | MissingPointerError;
8+
export type $RefError = JSONParserError | ResolverError | ParserError | MissingPointerError;
99

1010
/**
1111
* This class represents a single JSON reference and its resolved value.

lib/resolvers/file.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { promises as fs } from "fs";
1+
import fs from "fs";
22
import { ono } from "@jsdevtools/ono";
33
import * as url from "../util/url.js";
44
import { ResolverError } from "../util/errors.js";
@@ -31,8 +31,7 @@ export default {
3131
throw new ResolverError(ono.uri(err, `Malformed URI: ${file.url}`), file.url);
3232
}
3333
try {
34-
const data = await fs.readFile(path);
35-
return data;
34+
return await fs.promises.readFile(path);
3635
} catch (err: any) {
3736
throw new ResolverError(ono(err, `Error opening file "${path}"`), path);
3837
}

test/specs/internal-root-ref/internal-root-ref.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("Schema with $ref at root level", () => {
3333
expect(schema).to.deep.equal(dereferencedSchema);
3434
// Reference equality
3535
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
36-
expect(schema.properties.userId).to.equal(schema.definitions.user.properties.userId);
36+
expect(schema.properties.userId).to.deep.equal(schema.definitions.user.properties.userId);
3737
expect(parser.$refs.circular).to.equal(false);
3838
});
3939

test/specs/root/root.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe("Schema with a top-level (root) $ref", () => {
3939
expect(schema).to.deep.equal(dereferencedSchema);
4040
// Reference equality
4141
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
42-
expect(schema.properties.first).to.equal(schema.properties.last);
42+
expect(schema.properties.first).to.deep.equal(schema.properties.last);
4343
// The "circular" flag should NOT be set
4444
expect(parser.$refs.circular).to.equal(false);
4545
});

vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ export default defineConfig({
1313
passWithNoTests: true,
1414
reporters: ["verbose"],
1515
coverage: { reporter: ["lcov", "html", "text"] },
16+
poolOptions: {
17+
threads: {
18+
singleThread: true,
19+
},
20+
},
1621
},
1722
});

0 commit comments

Comments
 (0)