Skip to content

Commit f08d982

Browse files
committed
fix tests
1 parent cd29b47 commit f08d982

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/editor/src/identifiers/paths/identifierPathHelpers.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
// http:localhost/_docs:/http:localhost/_docs/README.md
66
// http:localhost/_docs:/README.md
77

8-
import { describe, expect, it } from "vitest";
8+
import { beforeAll, describe, expect, it } from "vitest";
99
import {
1010
DefaultShorthandResolver,
11+
defaultShorthandResolver,
1112
identifiersToPath,
1213
pathToIdentifier,
1314
pathToIdentifiers,
@@ -19,6 +20,13 @@ import {
1920
// typecell:localhost/@yousef:/typecell:localhost/@yousef/id123
2021

2122
describe("Identifier", () => {
23+
beforeAll(() => {
24+
// hardcode to http:localhost instead of using window.location. This makes writing the tests easier
25+
defaultShorthandResolver.current.addShorthand(
26+
"docs",
27+
"http:localhost/_docs/"
28+
);
29+
});
2230
it("parses basic identifier", () => {
2331
const identifier = pathToIdentifier("http:localhost/_docs/README.md");
2432
expect(identifier.uri.scheme).toBe("http");

0 commit comments

Comments
 (0)