(existsAfterBuild: boolean)
| 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 () => { |
no test coverage detected