-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
176 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules | |
.dumi/tmp-test | ||
.dumi/tmp-production | ||
.DS_Store | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { mount, type VueWrapper } from '@vue/test-utils'; | ||
import { beforeEach, describe, expect, it } from 'vitest'; | ||
import Bar from './RootBar.vue'; | ||
|
||
describe('Bar', () => { | ||
let wrapper: VueWrapper<InstanceType<typeof Bar>>; | ||
|
||
beforeEach(() => { | ||
wrapper = mount(Bar, { props: { icon: 'V' } }); | ||
}); | ||
|
||
it('should render', () => { | ||
expect(wrapper.html()).contain('V'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.foo { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import { describe, expect, it } from 'vitest'; | ||
import { Foo } from './index'; | ||
|
||
describe('Foo', () => { | ||
it('should render', () => { | ||
const wrapper = mount(Foo, { props: { title: 'foo' } }); | ||
expect(wrapper.html()).contain('foo'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"emitDeclarationOnly": true, | ||
"declarationDir": "./dist/typings", | ||
"lib": ["esnext", "dom"] | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["src/**/*.test.*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineConfig } from 'vite'; | ||
import { resolve } from 'node:path'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
|
||
|
||
const externals = ['vue']; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
vue(), | ||
vueJsx(), | ||
], | ||
build: { | ||
lib: { | ||
entry: resolve(__dirname, 'src/index.ts'), | ||
name: 'index', | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: [...externals], | ||
output: { | ||
globals: { | ||
'vue': 'Vue', | ||
}, | ||
}, | ||
}, | ||
outDir: 'dist', | ||
}, | ||
resolve: { | ||
dedupe: ['vue'], | ||
}, | ||
optimizeDeps: { | ||
include: [...externals], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
|
||
|
||
export default defineConfig({ | ||
plugins: [ | ||
vue(), | ||
vueJsx(), | ||
], | ||
test: { | ||
environment: 'happy-dom', | ||
include: ['./**/*.test.{ts,js,tsx}'], | ||
coverage: { | ||
provider: 'v8', | ||
reporter: ['html', 'text', 'json'], | ||
}, | ||
}, | ||
}); |