We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14f9a3d commit f7f0cb6Copy full SHA for f7f0cb6
src/backend/browser/fakePath.ts
@@ -3,7 +3,7 @@ import { uuid4 } from "@/helpers/random";
3
4
const fakePathSchema = z
5
.string()
6
- .regex(/^<browser-dummy-[0-9a-f]+>-.+$/)
+ .regex(/^<browser-dummy-[-0-9a-f]+>-.+$/)
7
.brand("FakePath");
8
export type FakePath = z.infer<typeof fakePathSchema>;
9
tests/unit/backend/browser/fakePath.spec.ts
@@ -0,0 +1,10 @@
1
+import { isFakePath, createFakePath } from "@/backend/browser/fakePath";
2
+
+it.each([
+ "spaced file name",
+ "filename-with-extension.wav",
+ "日本語ファイル名",
+])("FakePathを作れて検証もできる: %s", (input) => {
+ const fakePath = createFakePath(input);
+ expect(isFakePath(fakePath)).toBe(true);
10
+});
0 commit comments