Skip to content

Commit

Permalink
chore: update vitest (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored May 16, 2024
1 parent 2b6b471 commit 53ad768
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 136 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"prettier": "2.8.8",
"publint": "0.1.11",
"turbo": "^1.10.13",
"vitest": "^0.34.6"
"vitest": "1.6.0"
},
"homepage": "https://sdk.vercel.ai/docs",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/anthropic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"type-check": "tsc --noEmit",
"prettier-check": "prettier --check \"./**/*.ts*\"",
"test": "pnpm test:node && pnpm test:edge",
"test:edge": "vitest --config vitest.edge.config.js --run --threads=false",
"test:node": "vitest --config vitest.node.config.js --run --threads=false"
"test:edge": "vitest --config vitest.edge.config.js --run",
"test:node": "vitest --config vitest.node.config.js --run"
},
"exports": {
"./package.json": "./package.json",
Expand Down
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"type-check": "tsc --noEmit",
"prettier-check": "prettier --check \"./**/*.ts*\"",
"test": "pnpm test:node && pnpm test:edge && pnpm test:ui",
"test:edge": "vitest --config vitest.edge.config.js --run --threads=false",
"test:node": "vitest --config vitest.node.config.js --run --threads=false",
"test:node:core": "pnpm vitest --config vitest.node.config.js --run --threads=false ./core/",
"test:edge": "vitest --config vitest.edge.config.js --run",
"test:node": "vitest --config vitest.node.config.js --run",
"test:node:core": "pnpm vitest --config vitest.node.config.js --run ./core/",
"test:ui": "pnpm test:ui:react && pnpm test:ui:vue && pnpm test:ui:solid",
"test:ui:react": "vitest --config vitest.ui.react.config.js --run",
"test:ui:solid": "vitest --config vitest.ui.solid.config.js --run",
"test:ui:vue": "vitest --config vitest.ui.vue.config.js --run",
"test:edge:watch": "vitest --config vitest.edge.config.js --threads=false",
"test:node:watch": "vitest --config vitest.node.config.js --threads=false",
"test:edge:watch": "vitest --config vitest.edge.config.js",
"test:node:watch": "vitest --config vitest.node.config.js",
"test:ui:react:watch": "vitest --config vitest.ui.react.config.js",
"test:ui:solid:watch": "vitest --config vitest.ui.solid.config.js",
"test:ui:vue:watch": "vitest --config vitest.ui.vue.config.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rsc/shared-client/streamable.ui.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ describe('rsc - readStreamableValue()', () => {
expect(() =>
streamable.update('world'),
).toThrowErrorMatchingInlineSnapshot(
'".update(): Value stream is locked and cannot be updated."',
'[Error: .update(): Value stream is locked and cannot be updated.]',
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ exports[`result.value > should render text 1`] = `
"done": false,
"next": {
"done": true,
"value": "{ \\"content\\": \\"Hello, world!\\" }",
"value": "{ "content": "Hello, world!" }",
},
"value": "{ \\"content\\": \\"Hello, world!\\" }",
"value": "{ "content": "Hello, world!" }",
},
"value": "{ \\"content\\": \\"Hello, world!\\"",
"value": "{ "content": "Hello, world!"",
},
"value": "{ \\"content\\": \\"Hello, world",
"value": "{ "content": "Hello, world",
},
"value": "{ \\"content\\": \\"Hello, ",
"value": "{ "content": "Hello, ",
},
"value": "{ \\"content\\": ",
"value": "{ "content": ",
},
"value": "{ ",
},
Expand Down
50 changes: 25 additions & 25 deletions packages/core/rsc/streamable.ui.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,16 @@ describe('rsc - createStreamableUI()', () => {
ui.done();

expect(await flightRender(ui.value)).toMatchInlineSnapshot(`
"1:\\"$Sreact.suspense\\"
2:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
0:[\\"$\\",\\"$1\\",null,{\\"fallback\\":\\"hello\\",\\"children\\":\\"$L2\\"}]
3:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
2:[\\"hello\\",[\\"$\\",\\"$1\\",null,{\\"fallback\\":\\" world\\",\\"children\\":\\"$L3\\"}]]
4:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
3:[\\" world\\",[\\"$\\",\\"$1\\",null,{\\"fallback\\":\\" and\\",\\"children\\":\\"$L4\\"}]]
5:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
4:[\\" and\\",[\\"$\\",\\"$1\\",null,{\\"fallback\\":\\" universe\\",\\"children\\":\\"$L5\\"}]]
5:\\" universe\\"
"1:"$Sreact.suspense"
2:D{"name":"","env":"Server"}
0:["$","$1",null,{"fallback":"hello","children":"$L2"}]
3:D{"name":"","env":"Server"}
2:["hello",["$","$1",null,{"fallback":" world","children":"$L3"}]]
4:D{"name":"","env":"Server"}
3:[" world",["$","$1",null,{"fallback":" and","children":"$L4"}]]
5:D{"name":"","env":"Server"}
4:[" and",["$","$1",null,{"fallback":" universe","children":"$L5"}]]
5:" universe"
"
`);

Expand All @@ -424,7 +424,7 @@ describe('rsc - createStreamableUI()', () => {
expect(() => {
ui.update(<div>3</div>);
}).toThrowErrorMatchingInlineSnapshot(
'".update(): UI stream is already closed."',
'[Error: .update(): UI stream is already closed.]',
);
});

Expand All @@ -440,12 +440,12 @@ describe('rsc - createStreamableUI()', () => {
ui.done();

expect(await flightRender(ui.value)).toMatchInlineSnapshot(`
"1:\\"$Sreact.suspense\\"
2:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
0:[\\"$\\",\\"$1\\",null,{\\"fallback\\":[\\"$\\",\\"div\\",null,{\\"children\\":\\"1\\"}],\\"children\\":\\"$L2\\"}]
4:{\\"children\\":\\"1\\"}
3:[\\"$\\",\\"div\\",null,\\"$4\\"]
2:\\"$3\\"
"1:"$Sreact.suspense"
2:D{"name":"","env":"Server"}
0:["$","$1",null,{"fallback":["$","div",null,{"children":"1"}],"children":"$L2"}]
4:{"children":"1"}
3:["$","div",null,"$4"]
2:"$3"
"
`);
});
Expand All @@ -457,14 +457,14 @@ describe('rsc - createStreamableUI()', () => {
.done(<div>4</div>);

expect(await flightRender(ui.value)).toMatchInlineSnapshot(`
"1:\\"$Sreact.suspense\\"
2:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
0:[\\"$\\",\\"$1\\",null,{\\"fallback\\":[\\"$\\",\\"div\\",null,{\\"children\\":\\"1\\"}],\\"children\\":\\"$L2\\"}]
3:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
2:[\\"$\\",\\"$1\\",null,{\\"fallback\\":[\\"$\\",\\"div\\",null,{\\"children\\":\\"2\\"}],\\"children\\":\\"$L3\\"}]
4:D{\\"name\\":\\"\\",\\"env\\":\\"Server\\"}
3:[\\"$\\",\\"$1\\",null,{\\"fallback\\":[\\"$\\",\\"div\\",null,{\\"children\\":\\"3\\"}],\\"children\\":\\"$L4\\"}]
4:[\\"$\\",\\"div\\",null,{\\"children\\":\\"4\\"}]
"1:"$Sreact.suspense"
2:D{"name":"","env":"Server"}
0:["$","$1",null,{"fallback":["$","div",null,{"children":"1"}],"children":"$L2"}]
3:D{"name":"","env":"Server"}
2:["$","$1",null,{"fallback":["$","div",null,{"children":"2"}],"children":"$L3"}]
4:D{"name":"","env":"Server"}
3:["$","$1",null,{"fallback":["$","div",null,{"children":"3"}],"children":"$L4"}]
4:["$","div",null,{"children":"4"}]
"
`);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/google/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"type-check": "tsc --noEmit",
"prettier-check": "prettier --check \"./**/*.ts*\"",
"test": "pnpm test:node && pnpm test:edge",
"test:edge": "vitest --config vitest.edge.config.js --run --threads=false",
"test:node": "vitest --config vitest.node.config.js --run --threads=false"
"test:edge": "vitest --config vitest.edge.config.js --run",
"test:node": "vitest --config vitest.node.config.js --run"
},
"exports": {
"./package.json": "./package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/mistral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"type-check": "tsc --noEmit",
"prettier-check": "prettier --check \"./**/*.ts*\"",
"test": "pnpm test:node && pnpm test:edge",
"test:edge": "vitest --config vitest.edge.config.js --run --threads=false",
"test:node": "vitest --config vitest.node.config.js --run --threads=false"
"test:edge": "vitest --config vitest.edge.config.js --run",
"test:node": "vitest --config vitest.node.config.js --run"
},
"exports": {
"./package.json": "./package.json",
Expand Down
4 changes: 2 additions & 2 deletions packages/openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"type-check": "tsc --noEmit",
"prettier-check": "prettier --check \"./**/*.ts*\"",
"test": "pnpm test:node && pnpm test:edge",
"test:edge": "vitest --config vitest.edge.config.js --run --threads=false",
"test:node": "vitest --config vitest.node.config.js --run --threads=false"
"test:edge": "vitest --config vitest.edge.config.js --run",
"test:node": "vitest --config vitest.node.config.js --run"
},
"exports": {
"./package.json": "./package.json",
Expand Down
Loading

0 comments on commit 53ad768

Please sign in to comment.