Skip to content

Commit ffd7417

Browse files
Fix test
1 parent bbb0a8e commit ffd7417

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

integrations/upgrade/index.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ test(
390390
},
391391
},
392392
async ({ fs, exec }) => {
393-
console.log(await exec('npx @tailwindcss/upgrade'))
393+
await exec('npx @tailwindcss/upgrade')
394394

395395
await fs.expectFileToContain('src/index.css', css`@import 'tailwindcss';`)
396396
await fs.expectFileToContain(
@@ -465,7 +465,7 @@ test(
465465
},
466466
},
467467
async ({ fs, exec }) => {
468-
console.log(await exec('npx @tailwindcss/upgrade'))
468+
await exec('npx @tailwindcss/upgrade')
469469

470470
await fs.expectFileToContain('src/index.css', css`@import 'tailwindcss';`)
471471
await fs.expectFileToContain(
@@ -476,16 +476,18 @@ test(
476476
`,
477477
)
478478

479-
let packageJsonContent = await fs.read('.postcssrc.json')
480-
let packageJson = JSON.parse(packageJsonContent)
481-
expect(packageJson).toMatchInlineSnapshot(`
479+
let jsonConfigContent = await fs.read('.postcssrc.json')
480+
let jsonConfig = JSON.parse(jsonConfigContent)
481+
expect(jsonConfig).toMatchInlineSnapshot(`
482482
{
483483
"plugins": {
484484
"@tailwindcss/postcss": {},
485485
},
486486
}
487487
`)
488488

489+
let packageJsonContent = await fs.read('package.json')
490+
let packageJson = JSON.parse(packageJsonContent)
489491
expect(packageJson.dependencies).toMatchObject({
490492
tailwindcss: expect.stringContaining('4.0.0'),
491493
})

packages/@tailwindcss-upgrade/src/migrate-postcss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export async function migratePostCSSConfig(base: string) {
5959
// Priority 3: JSON based postcss config files
6060
let jsonConfigPath = await detectJSONConfigPath(base)
6161
let jsonConfig: null | any = null
62-
if (jsonConfigPath) {
62+
if (!didMigrate && jsonConfigPath) {
6363
try {
6464
jsonConfig = JSON.parse(await fs.readFile(jsonConfigPath, 'utf-8'))
6565
} catch {}

0 commit comments

Comments
 (0)