diff --git a/packages/vitest/src/integrations/snapshot/chai.ts b/packages/vitest/src/integrations/snapshot/chai.ts index 27bd424e4fef..22cd0a1aa33e 100644 --- a/packages/vitest/src/integrations/snapshot/chai.ts +++ b/packages/vitest/src/integrations/snapshot/chai.ts @@ -146,7 +146,7 @@ export const SnapshotPlugin: ChaiPlugin = (chai, utils) => { const isInsideEach = test.each || test.suite?.each if (isInsideEach) { throw new Error( - 'InlineSnapshot cannot be used inside of test.each or describe.each', + 'InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead', ) } const expected = utils.flag(this, 'object') diff --git a/test/cli/test/__snapshots__/fails.test.ts.snap b/test/cli/test/__snapshots__/fails.test.ts.snap index 78cd736b7d35..6596db542be1 100644 --- a/test/cli/test/__snapshots__/fails.test.ts.snap +++ b/test/cli/test/__snapshots__/fails.test.ts.snap @@ -48,11 +48,11 @@ Error: Hook timed out in 102ms." `; exports[`should fail inline-snapshop-inside-each.test.ts 1`] = ` -"Error: InlineSnapshot cannot be used inside of test.each or describe.each -Error: InlineSnapshot cannot be used inside of test.each or describe.each -Error: InlineSnapshot cannot be used inside of test.each or describe.each -Error: InlineSnapshot cannot be used inside of test.each or describe.each -Error: InlineSnapshot cannot be used inside of test.each or describe.each" +"Error: InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead +Error: InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead +Error: InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead +Error: InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead +Error: InlineSnapshot cannot be used inside of test.each or describe.each. Use toMatchSnapshot instead" `; exports[`should fail mock-import-proxy-module.test.ts 1`] = `"Error: There are some problems in resolving the mocks API."`;