From bda795066d527ef0dc9d03d92d28a0f8557f1d78 Mon Sep 17 00:00:00 2001 From: bucai <1450941858@qq.com> Date: Mon, 22 Nov 2021 12:27:13 +0800 Subject: [PATCH] update package --- .gitignore | 1 + README.md | 3 ++ package.json | 7 +-- src/__test__/index.spec.tsx | 12 ++++- yarn.lock | 101 +++++++++++++++++++++++++++++++++--- 5 files changed, 111 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index faa338e..6230f65 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ coverage # local env files .env.local .env.*.local +codecov.yml # Log files npm-debug.log* diff --git a/README.md b/README.md index d6e6674..43569e4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ This is an element-Puls table component that can be configured to perform comple GitHub issues GitHub GitHub package.json version + + +

diff --git a/package.json b/package.json index 47a661b..3d92fc1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "*.vue" ], "scripts": { - "test": "jest --coverage", + "test": "jest --coverage && codecov", "dev": "rollup --config ./build/rollup.config.js --watch --sourcemap", "build": "cross-env NODE_ENV=production rollup --config ./build/rollup.config.js --sourcemap", "website:dev": "webpack server --profile --config ./website/webpack.config.js", @@ -61,12 +61,13 @@ "@vue/babel-plugin-jsx": "^1.1.1", "@vue/cli-plugin-babel": "^4.5.13", "@vue/compiler-sfc": "^3.2.22", - "@vue/test-utils": "^2.0.0-rc.12", + "@vue/test-utils": "^2.0.0-rc.17", "babel-loader": "^8.2.2", "babel-plugin-import": "^1.13.3", "babel-plugin-lodash": "^3.3.4", "babel-plugin-module-resolver": "^4.1.0", "clipboard-copy": "^4.0.1", + "codecov": "^3.8.3", "colors": "^1.4.0", "cross-env": "^7.0.3", "crypto-browserify": "^3.12.0", @@ -135,4 +136,4 @@ "element-plus": "^1.2.0-beta.3", "vue": "^3.2.22" } -} \ No newline at end of file +} diff --git a/src/__test__/index.spec.tsx b/src/__test__/index.spec.tsx index 4cd58b3..71fe0f1 100644 --- a/src/__test__/index.spec.tsx +++ b/src/__test__/index.spec.tsx @@ -5,9 +5,17 @@ import { ElButton } from 'element-plus' import TableData from '../components/table-data.vue' import flushPromises from 'flush-promises' +window.ResizeObserver = +window.ResizeObserver || +jest.fn().mockImplementation(() => ({ + disconnect: jest.fn(), + observe: jest.fn(), + unobserve: jest.fn(), +})); + const mount = (opt: any) => _mount(opt, { - attachTo: 'body', + // attachTo: 'body', }) function getTestData () { @@ -51,6 +59,7 @@ function getTestData () { } describe('Table.vue', () => { + describe('rendering data is correct', () => { const wrapper = mount({ components: { @@ -127,7 +136,6 @@ describe('Table.vue', () => { const wrapper = mount({ components: { TableData, - ElButton, }, template: `