MCPcopy
hub / github.com/vercel/next.js / checkFileWrite

Function checkFileWrite

test/production/clean-distdir/index.test.ts:19–34  ·  view source on GitHub ↗
(existsAfterBuild: boolean)

Source from the content-addressed store, hash-verified

17 })
18
19 async function checkFileWrite(existsAfterBuild: boolean) {
20 await next.build()
21
22 const customFile = '.next/extra-file.txt'
23 await next.patchFile(customFile, 'this is a testing file')
24
25 await next.build()
26
27 expect(await next.hasFile(customFile)).toBe(existsAfterBuild)
28
29 // `.next/cache` should be preserved in all cases
30 expect(await next.hasFile('.next/cache')).toBe(true)
31 if (!isTurbopack) {
32 expect(await next.hasFile('.next/cache/swc')).toBe(true)
33 }
34 }
35
36 describe('disabled write', () => {
37 it('should clean up .next before build start', async () => {

Callers 1

index.test.tsFile · 0.85

Calls 4

hasFileMethod · 0.80
expectFunction · 0.50
buildMethod · 0.45
patchFileMethod · 0.45

Tested by

no test coverage detected