Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed May 3, 2022
1 parent 027fc71 commit 0856fb2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/playground/vue/Main.vue
Expand Up @@ -15,6 +15,7 @@
<div class="slotted">this should be red</div>
</Slotted>
<ScanDep />
<TsImport />
<Suspense>
<AsyncComponent />
</Suspense>
Expand All @@ -33,6 +34,7 @@ import CustomBlock from './CustomBlock.vue'
import SrcImport from './src-import/SrcImport.vue'
import Slotted from './Slotted.vue'
import ScanDep from './ScanDep.vue'
import TsImport from './TsImport.vue'
import AsyncComponent from './AsyncComponent.vue'
import ReactivityTransform from './ReactivityTransform.vue'
import SetupImportTemplate from './setup-import-template/SetupImportTemplate.vue'
Expand Down
8 changes: 8 additions & 0 deletions packages/playground/vue/TsImport.vue
@@ -0,0 +1,8 @@
<template>
<h2>Ts Import</h2>
<p class="ts-import">{{ foo }}</p>
</template>

<script setup lang="ts">
import { foo } from './TsImportFile.js'
</script>
1 change: 1 addition & 0 deletions packages/playground/vue/TsImportFile.ts
@@ -0,0 +1 @@
export const foo = 'success'
4 changes: 4 additions & 0 deletions packages/playground/vue/__tests__/vue.spec.ts
Expand Up @@ -14,6 +14,10 @@ test('template/script latest syntax support', async () => {
expect(await page.textContent('.syntax')).toBe('baz')
})

test('import ts with .js extension with lang="ts"', async () => {
expect(await page.textContent('.ts-import')).toBe('success')
})

test('should remove comments in prod', async () => {
expect(await page.innerHTML('.comments')).toBe(isBuild ? `` : `<!--hello-->`)
})
Expand Down

0 comments on commit 0856fb2

Please sign in to comment.