test sfc parser <style module>

This commit is contained in:
Evan You 2016-11-03 16:25:53 -04:00
parent d9efc6a92b
commit bc455352a3

View File

@ -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 {}')
})