diff --git a/test/reporters/fixtures/code-frame-line-limit.test.ts b/test/reporters/fixtures/code-frame-line-limit.test.ts new file mode 100644 index 000000000000..bda42b218136 --- /dev/null +++ b/test/reporters/fixtures/code-frame-line-limit.test.ts @@ -0,0 +1,6 @@ +import { test, expect } from "vitest" + +test("basic", () => { + // line length is 85 but highlight makes this line 245 chars + expect([{ prop: 7 }, { prop: 7 }, { prop: 7 }, { prop: 7 }]).toBe([{ another: 8 }]) +}) diff --git a/test/reporters/tests/code-frame-line-limit.test.ts b/test/reporters/tests/code-frame-line-limit.test.ts new file mode 100644 index 000000000000..39fb25b31f53 --- /dev/null +++ b/test/reporters/tests/code-frame-line-limit.test.ts @@ -0,0 +1,9 @@ +import { expect, test } from 'vitest' +import { resolve } from 'pathe' +import { runVitest } from '../../test-utils' + +test('show code frame', async () => { + const filename = resolve('./fixtures/code-frame-line-limit.test.ts') + const { stderr } = await runVitest({ root: './fixtures' }, [filename]) + expect(stderr).toContain('5| expect([{ prop: 7 },') +})