Skip to content

Commit 569dc08

Browse files
committed
chore(postcss): add compat test case
1 parent 825936a commit 569dc08

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`compat > styleHandler calc 1`] = `
4+
"
5+
page{
6+
--spacing: 8rpx;
7+
--radius-3xl: 48rpx;
8+
--radius-4xl: calc(var(--spacing) * 8);
9+
}"
10+
`;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { createStyleHandler } from '@/index'
2+
3+
describe('compat', () => {
4+
it('styleHandler calc', async () => {
5+
const styleHandler = createStyleHandler({
6+
isMainChunk: true,
7+
cssPresetEnv: {
8+
features: {
9+
'custom-properties': true,
10+
'nested-calc': true,
11+
},
12+
// browsers: ['defaults'],
13+
},
14+
})
15+
const { css } = await styleHandler(`
16+
:root{
17+
--spacing: 8rpx;
18+
--radius-3xl: 48rpx;
19+
--radius-4xl: calc(var(--spacing) * 8);
20+
}`,
21+
)
22+
expect(css).toMatchSnapshot()
23+
})
24+
})

0 commit comments

Comments
 (0)