Skip to content

Commit

Permalink
chore: Upgrade vitest 1 (#142)
Browse files Browse the repository at this point in the history
* chore: Upgrade vitest 1

* relock

* update snapshots
  • Loading branch information
manzt authored Jan 14, 2024
1 parent 191d95c commit af26d79
Show file tree
Hide file tree
Showing 7 changed files with 1,165 additions and 666 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ browser, run `pnpm build` and start a web-server in the root of the repository:

```sh
python3 -m http.server .
# navigate to localhost:8000
# navigate to localhost:8000/demo.html
```

You can edit the contents of `index.html` and refresh the page.
You can edit the contents of `demo.html` and refresh the page.
File renamed without changes.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"test": "vitest --api",
"fmt": "dprint fmt",
"lint": "dprint check",
"publint": "pnpm --recursive --filter=\"./packages/**\" exec publint",
"errors": "vim -c \"copen\" -c \"cexpr system('npx build')\" -c \"wincmd p\""
"publint": "pnpm --recursive --filter=\"./packages/**\" exec publint"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
Expand All @@ -16,6 +15,6 @@
"dprint": "^0.45.0",
"publint": "^0.2.2",
"typescript": "^5.3.3",
"vitest": "^0.33.0"
"vitest": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/core/__tests__/consolidated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe("withConsolidated", () => {
let try_open = () => withConsolidated(new FileSystemStore(root));
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v2 consolidated metadata"',
`[NodeNotFoundError: Node not found: v2 consolidated metadata]`,
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/__tests__/open.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ describe("v2", () => {
open.v2(store.resolve("/not/a/group"), { kind: "group" });
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v2 group"',
`[NodeNotFoundError: Node not found: v2 group]`,
);
});

Expand Down Expand Up @@ -724,7 +724,7 @@ describe("v3", () => {
open.v3(store.resolve("/not/a/group"), { kind: "group" });
await expect(try_open).rejects.toThrowError(NodeNotFoundError);
await expect(try_open).rejects.toThrowErrorMatchingInlineSnapshot(
'"Node not found: v3 array or group"',
`[NodeNotFoundError: Node not found: v3 array or group]`,
);
});

Expand Down
6 changes: 3 additions & 3 deletions packages/storage/__tests__/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("FetchStore", () => {

it("returns undefined for missing file", async () => {
let store = new FetchStore(href);
expect(await store.get("/missing.json")).toBeUndefined();
expect(await store.get("/some/random/file/missing.duh")).toBeUndefined();
});

it("forwards request options to fetch", async () => {
Expand Down Expand Up @@ -127,15 +127,15 @@ describe("FetchStore", () => {
let store = new FetchStore(href);
let bytes = await store.getRange("/zarr.json", { suffixLength: 50 });
expect(new TextDecoder().decode(bytes)).toMatchInlineSnapshot(
'"utes\\": {}, \\"zarr_format\\": 3, \\"node_type\\": \\"group\\"}"',
`"utes": {}, "zarr_format": 3, "node_type": "group"}"`,
);
});

it("reads partial - offset, length", async () => {
let store = new FetchStore(href);
let bytes = await store.getRange("/zarr.json", { offset: 4, length: 50 });
expect(new TextDecoder().decode(bytes)).toMatchInlineSnapshot(
'"tributes\\": {}, \\"zarr_format\\": 3, \\"node_type\\": \\"gro"',
`"tributes": {}, "zarr_format": 3, "node_type": "gro"`,
);
});
});
Loading

0 comments on commit af26d79

Please sign in to comment.