feat(cpa): handle next.js app with and without src dir

This commit is contained in:
Elliot DeNolf
2024-03-29 16:45:45 -04:00
parent 403a86feca
commit 7619fb4753
4 changed files with 101 additions and 36 deletions

View File

@@ -47,10 +47,16 @@ describe('parseAndInsertWithPayload', () => {
// Unsupported: export { wrapped as default }
it('should give warning with a named export as default', () => {
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(() => {})
const { modifiedConfigContent, success } = parseAndModifyConfigContent(
nextConfigExportNamedDefault,
)
expect(modifiedConfigContent).toContain(withPayloadImportStatement)
expect(success).toBe(false)
expect(consoleLogSpy).toHaveBeenCalledWith(
expect.stringContaining('Could not automatically wrap'),
)
})
})