mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### Why? We had breaking change in App Router at https://github.com/vercel/next.js/pull/70480 where it strictly checks `runtime` route segment config. If it is set to `experimental-edge`, will throw. Therefore we support a codemod to replace it to `edge`.
14 lines
605 B
JavaScript
14 lines
605 B
JavaScript
/* global jest */
|
|
jest.autoMockOff()
|
|
const defineTest = require('jscodeshift/dist/testUtils').defineTest
|
|
const { readdirSync } = require('fs')
|
|
const { join } = require('path')
|
|
const fixtureDir = 'app-dir-runtime-config-experimental-edge'
|
|
const fixtureDirPath = join(__dirname, '..', '__testfixtures__', fixtureDir)
|
|
const fixtures = readdirSync(fixtureDirPath)
|
|
.filter(file => file.endsWith('.input.tsx'))
|
|
.map(file => file.replace('.input.tsx', ''))
|
|
for (const fixture of fixtures) {
|
|
const prefix = `${fixtureDir}/${fixture}`;
|
|
defineTest(__dirname, fixtureDir, null, prefix, { parser: 'tsx' });
|
|
} |