Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 1, 2024
1 parent eb5d680 commit ca2afdc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/reporters/fixtures/code-frame-line-limit.test.ts
Original file line number Diff line number Diff line change
@@ -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 }])
})
9 changes: 9 additions & 0 deletions test/reporters/tests/code-frame-line-limit.test.ts
Original file line number Diff line number Diff line change
@@ -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 },')
})

0 comments on commit ca2afdc

Please sign in to comment.