Skip to content

Commit

Permalink
chore: add typecheck from ci
Browse files Browse the repository at this point in the history
  • Loading branch information
deot committed Dec 16, 2023
1 parent 968a7bd commit fa33328
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:

- run: pnpm install

- name: Run typecheck
run: npm run typecheck

- name: Run unit tests
run: npm run test -- --package-name '*'

Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"**/*.{css,scss}": [
"stylelint --fix"
],
"*.{js,ts,jsx,tsx,md}": [
"**/*.{js,ts,jsx,tsx,md}": [
"eslint --fix"
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"build": "ddc build --vue-package 'components,hooks' --script-formats=es,cjs,umd,iife --external vue",
"test": "ddc test --vue-package 'components,hooks'",
"add": "ddc add",
"release": "ddc release"
"release": "ddc release",
"typecheck": "vue-tsc --noEmit --skipLibCheck"
},
"scripts-info": {
"init": "首次安装",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/customer/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('index.ts', () => {
expect(wrapper.find('.default').text()).toBe('default-slot');
expect(wrapper.find('.content').text()).toBe('content-slot-1');

await wrapper.setProps({ current: 1 });
await wrapper.setProps({ current: 1 } as any);

expect(wrapper.classes()).toEqual(['child', 'parent']);
expect(wrapper.find('.attrs').text()).toBe('1');
Expand Down
4 changes: 2 additions & 2 deletions packages/components/message/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @vitest-environment jsdom

import { Message } from '@deot/vc-components';
import { Message, MessageView } from '@deot/vc-components';
import { mount } from '@vue/test-utils';

describe('index.ts', () => {
it('basic', () => {
expect(typeof Message).toBe('object');
});
it('create', async () => {
const wrapper = mount(() => (<Message />));
const wrapper = mount(() => (<MessageView />));

expect(wrapper.classes()).toContain('vc-message');
});
Expand Down
4 changes: 2 additions & 2 deletions packages/components/modal/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @vitest-environment jsdom

import { Modal } from '@deot/vc-components';
import { Modal, ModalView } from '@deot/vc-components';
import { mount } from '@vue/test-utils';

describe('index.ts', () => {
it('basic', () => {
expect(typeof Modal).toBe('object');
});
it('create', async () => {
const wrapper = mount(() => (<Modal />));
const wrapper = mount(() => (<ModalView />));

expect(wrapper.classes()).toContain('vc-modal');
});
Expand Down
4 changes: 2 additions & 2 deletions packages/components/notice/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @vitest-environment jsdom

import { Notice } from '@deot/vc-components';
import { Notice, NoticeView } from '@deot/vc-components';
import { mount } from '@vue/test-utils';

describe('index.ts', () => {
it('basic', () => {
expect(typeof Notice).toBe('object');
});
it('create', async () => {
const wrapper = mount(() => (<Notice />));
const wrapper = mount(() => (<NoticeView />));

expect(wrapper.classes()).toContain('vc-notice');
});
Expand Down
4 changes: 2 additions & 2 deletions packages/components/toast/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @vitest-environment jsdom

import { Toast } from '@deot/vc-components';
import { Toast, ToastView } from '@deot/vc-components';
import { mount } from '@vue/test-utils';

describe('index.ts', () => {
it('basic', () => {
expect(typeof Toast).toBe('object');
});
it('create', async () => {
const wrapper = mount(() => (<Toast />));
const wrapper = mount(() => (<ToastView />));

expect(wrapper.classes()).toContain('vc-toast');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/components/vc/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('index.ts', () => {
};
VcInstance.configure();
VcInstance.configure(options);
expect((VcInstance.options.Theme.variables as any).background).toBe('white');
expect((VcInstance.options.Theme!.variables).background).toBe('white');
});

it('VcInstance, globalEvent', async () => {
Expand Down

0 comments on commit fa33328

Please sign in to comment.