Skip to content

Commit 50a8f87

Browse files
committed
Speed up isSafeMigration tests
1 parent 9ec6242 commit 50a8f87

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@ import * as versions from '../../utils/version'
44
import { migrateCandidate } from './migrate'
55
vi.spyOn(versions, 'isMajor').mockReturnValue(true)
66

7+
const css = String.raw
8+
79
describe('is-safe-migration', async () => {
8-
let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss";', {
9-
base: __dirname,
10-
})
10+
let designSystem = await __unstable__loadDesignSystem(
11+
css`
12+
@import 'tailwindcss';
13+
14+
/* TODO(perf): Only here to speed up the tests */
15+
@theme {
16+
--*: initial;
17+
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
18+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
19+
}
20+
`,
21+
{ base: __dirname },
22+
)
1123

1224
test.each([
1325
[`let notBorder = !border \n`, '!border'],

0 commit comments

Comments
 (0)