MCPcopy
hub / github.com/vitejs/vite / tests

Function tests

playground/transform-plugin/__tests__/tests.ts:4–15  ·  playground/transform-plugin/__tests__/tests.ts::tests
()

Source from the content-addressed store, hash-verified

2import { editFile, isBuild, page } from class="st">'~utils'
3
4export const tests = () => {
5 test(class="st">'should re-run transform when dependencies are edited', async () => {
6 expect(await page.textContent(class="st">'#transform-count')).toBe(class="st">'1')
7
8 if (isBuild) return
9 editFile(class="st">'plugin-dep.js', (str) => str + class="st">' ')
10 await expect.poll(() => page.textContent(class="st">'#transform-count')).toBe(class="st">'2')
11
12 editFile(class="st">'plugin-dep-load.js', (str) => str + class="st">' ')
13 await expect.poll(() => page.textContent(class="st">'#transform-count')).toBe(class="st">'3')
14 })
15}

Callers 2

Calls 2

testFunction · 0.90
editFileFunction · 0.50

Tested by

no test coverage detected