diff --git a/test/snapshots/package.json b/test/snapshots/package.json new file mode 100644 index 000000000..52882d1e4 --- /dev/null +++ b/test/snapshots/package.json @@ -0,0 +1,9 @@ +{ + "name": "@vitest/snapshots", + "private": true, + "scripts": { + "test": "vitest", + "testu": "vitest -u", + "coverage": "vitest --coverage" + } +} \ No newline at end of file diff --git a/test/snapshots/test/shapshots.test.ts b/test/snapshots/test/shapshots.test.ts new file mode 100644 index 000000000..220512dbb --- /dev/null +++ b/test/snapshots/test/shapshots.test.ts @@ -0,0 +1,9 @@ +test('non default snapshot format', () => { + expect({ foo: ['bar'] }).toMatchInlineSnapshot(` + Object { + "foo": Array [ + "bar", + ], + } + `) +}) diff --git a/test/snapshots/vitest.config.ts b/test/snapshots/vitest.config.ts new file mode 100644 index 000000000..cb5f02483 --- /dev/null +++ b/test/snapshots/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + test: { + global: true, + snapshotFormat: { + printBasicPrototype: true, + }, + }, +})