Skip to content

Commit 4999043

Browse files
committed
add failing test
1 parent 6a52253 commit 4999043

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

integrations/upgrade/index.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,6 +3043,58 @@ test(
30433043
},
30443044
)
30453045

3046+
test(
3047+
'upgrades can run in a pnpm workspace root',
3048+
{
3049+
fs: {
3050+
'pnpm-workspace.yaml': yaml`
3051+
#
3052+
packages:
3053+
- .
3054+
`,
3055+
'package.json': json`
3056+
{
3057+
"dependencies": {
3058+
"tailwindcss": "^4"
3059+
},
3060+
"devDependencies": {
3061+
"@tailwindcss/upgrade": "workspace:^"
3062+
}
3063+
}
3064+
`,
3065+
'src/index.html': html`
3066+
<!-- Migrating 'ring', 'rounded' and 'outline-none' are unsafe in v4 -> v4 migrations -->
3067+
<div class="ring rounded outline"></div>
3068+
3069+
<!-- Variant order is also unsafe to change in v4 projects -->
3070+
<div class="file:hover:flex *:hover:flex"></div>
3071+
<div class="hover:file:flex hover:*:flex"></div>
3072+
3073+
<!-- These are safe to migrate: -->
3074+
<div
3075+
class="!flex bg-red-500/[var(--my-opacity)] [@media(pointer:fine)]:flex bg-right-bottom object-left-top"
3076+
></div>
3077+
`,
3078+
'src/input.css': css`
3079+
@import 'tailwindcss';
3080+
3081+
.foo {
3082+
@apply !bg-[var(--my-color)];
3083+
}
3084+
`,
3085+
},
3086+
},
3087+
async ({ exec, fs, expect }) => {
3088+
let stdout = await exec('npx @tailwindcss/upgrade')
3089+
3090+
expect(stdout).not.toContain(
3091+
'Running this command will add the dependency to the workspace root',
3092+
)
3093+
3094+
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot()
3095+
},
3096+
)
3097+
30463098
test(
30473099
'upgrade <style> blocks carefully',
30483100
{

0 commit comments

Comments
 (0)