Skip to content

Commit bc45535

Browse files
committed
test sfc parser <style module>
1 parent d9efc6a commit bc45535

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/unit/modules/sfc/sfc-parser.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ describe('Single File Component parser', () => {
1313
h2
1414
color green
1515
</style>
16+
<style module>
17+
h1 { font-weight: bold }
18+
</style>
1619
<script>
1720
export default {}
1821
</script>
@@ -21,11 +24,12 @@ describe('Single File Component parser', () => {
2124
</div>
2225
`)
2326
expect(res.template.content.trim()).toBe('<div>hi</div>')
24-
expect(res.styles.length).toBe(2)
27+
expect(res.styles.length).toBe(3)
2528
expect(res.styles[0].src).toBe('./test.css')
2629
expect(res.styles[1].lang).toBe('stylus')
2730
expect(res.styles[1].scoped).toBe(true)
2831
expect(res.styles[1].content.trim()).toBe('h1\n color red\nh2\n color green')
32+
expect(res.styles[2].module).toBe(true)
2933
expect(res.script.content.trim()).toBe('export default {}')
3034
})
3135

0 commit comments

Comments
 (0)