Skip to content

Commit

Permalink
feat(playground): add stylus + change lang test in vue
Browse files Browse the repository at this point in the history
  • Loading branch information
y1d7ng committed Jul 16, 2021
1 parent 0c276f9 commit a7ba636
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/playground/vue/PreProcessors.vue
Expand Up @@ -6,6 +6,9 @@ p.pug
p.pug-less
| This is rendered from <template lang="pug">
| and styled with <style lang="less">. It should be green.
p.pug-stylus
| This is rendered from <template lang="pug">
| and styled with <style lang="stylus">. It should be orange.
SlotComponent
template(v-slot:test-slot)
div.pug-slot slot content
Expand All @@ -32,3 +35,10 @@ $color: magenta;
color: @color;
}
</style>

<style lang="stylus">
color = orange
.pug-stylus
color: color
</style>
15 changes: 15 additions & 0 deletions packages/playground/vue/__tests__/vue.spec.ts
Expand Up @@ -56,6 +56,21 @@ describe('pre-processors', () => {
)
await untilUpdated(() => getColor(el), 'blue')
})

test('stylus + change lang', async () => {
expect(await getColor('p.pug-stylus')).toBe('orange')
editFile('PreProcessors.vue', (code) =>
code
.replace('<style lang="stylus">', '<style lang="scss">')
.replace('color = orange', '$color: yellow;')
.replace('color: color', '{ color: $color; }')
)
await untilUpdated(() => getColor('p.pug-stylus'), 'yellow')
editFile('PreProcessors.vue', (code) =>
code.replace('$color: yellow;', '$color: orange;')
)
await untilUpdated(() => getColor('p.pug-stylus'), 'orange')
})
})

describe('css modules', () => {
Expand Down

0 comments on commit a7ba636

Please sign in to comment.