mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-04 21:17:55 +08:00
test sfc parser <style module>
This commit is contained in:
parent
d9efc6a92b
commit
bc455352a3
@ -13,6 +13,9 @@ describe('Single File Component parser', () => {
|
||||
h2
|
||||
color green
|
||||
</style>
|
||||
<style module>
|
||||
h1 { font-weight: bold }
|
||||
</style>
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
@ -21,11 +24,12 @@ describe('Single File Component parser', () => {
|
||||
</div>
|
||||
`)
|
||||
expect(res.template.content.trim()).toBe('<div>hi</div>')
|
||||
expect(res.styles.length).toBe(2)
|
||||
expect(res.styles.length).toBe(3)
|
||||
expect(res.styles[0].src).toBe('./test.css')
|
||||
expect(res.styles[1].lang).toBe('stylus')
|
||||
expect(res.styles[1].scoped).toBe(true)
|
||||
expect(res.styles[1].content.trim()).toBe('h1\n color red\nh2\n color green')
|
||||
expect(res.styles[2].module).toBe(true)
|
||||
expect(res.script.content.trim()).toBe('export default {}')
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user