Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 单元测试增加jsdom相关测试 #34

Merged
merged 5 commits into from
Jul 11, 2023

Conversation

liyanjie2017
Copy link
Contributor

@liyanjie2017 liyanjie2017 commented Jul 4, 2023

  • 确保您遵循贡献指南:(中文)。
  • 确保将提交合并到 development 分支。
  • 添加一些描述以及相关问题/需求/讨论链接。

Closes #35

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Coverage Summary

Status Category Percentage Covered / Total
🔵 Lines 80.5% 941 / 1169
🔵 Statements 80.5% 941 / 1169
🔵 Functions 86.15% 56 / 65
🔵 Branches 82.41% 89 / 108
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
src/index.ts 100% 100% 100% 100%
src/lib/AJAXError.ts 0% 100% 0% 0% 1-14
src/lib/Coordinate.ts 100% 100% 100% 100%
src/lib/CoordinateUtils.ts 100% 94.73% 100% 100%
src/lib/ajax.ts 60.1% 33.33% 50% 60.1% 37-73, 108-113, 116-117, 122, 125-129, 134-151, 157-159, 186-188
src/lib/animation.ts 100% 100% 100% 100%
src/lib/browser.ts 37.5% 33.33% 100% 37.5% 32-77, 83-111
src/lib/common.ts 100% 100% 100% 100%
src/lib/computedTextWidth.ts 100% 100% 100% 100%
src/lib/cookie.ts 100% 100% 100% 100%
src/lib/date.ts 100% 100% 100% 100%
src/lib/dom.ts 100% 80% 100% 100%
src/lib/flex.ts 100% 33.33% 100% 100%
src/lib/getJson.ts 100% 100% 100% 100%
src/lib/load.ts 32.53% 100% 0% 32.53% 7-28, 36-41, 49-70, 78-83
src/lib/url.ts 96.96% 66.66% 100% 96.96% 28-29
src/lib/uuid.ts 100% 89.47% 100% 100%
src/lib/getStylePropertyValue.ts 100% 50% 100% 100%

@liunnn1994 liunnn1994 requested a review from alanwhy July 5, 2023 09:59
@liunnn1994
Copy link
Member

liunnn1994 commented Jul 5, 2023

Closes #35

Copy link
Contributor

@alanwhy alanwhy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liunnn1994 liunnn1994 force-pushed the feature/lyj-update branch from 77881f0 to 2161175 Compare July 11, 2023 02:40
@liunnn1994 liunnn1994 merged commit 0a1c5ed into development Jul 11, 2023
@liunnn1994 liunnn1994 deleted the feature/lyj-update branch July 11, 2023 02:54
@github-actions github-actions bot requested a review from alanwhy July 14, 2023 02:58
@liunnn1994 liunnn1994 added the enhancement New feature or request label Jul 14, 2023
@liunnn1994 liunnn1994 added this to the 完善测试 milestone Jul 14, 2023
@maguangweii
Copy link

y

alanwhy added a commit that referenced this pull request Jul 19, 2023
* ci: 新增 action 手动触发

* ci: 新增手动 action 提示

* chore(release): 1.1.0-beta.1 [skip ci]

# [1.1.0-beta.1](v1.0.0...v1.1.0-beta.1) (2023-06-14)

### Features

* 添加文档搜索功能 ([#24](#24)) ([9248fb6](9248fb6))

* docs: update README.md (#17)

* feat: 计算文字宽度

✅ Closes: #15

* chore(release): 1.0.0-development.1 [skip ci]

# 1.0.0-development.1 (2023-05-25)

### Features

* 清除历史日志,项目迁移 ([5ec0f43](5ec0f43))
* 计算文字宽度 ([b916185](b916185)), closes [#15](#15)
* 重置版本号 ([55def4a](55def4a))

* docs: update README.md

---------

Co-authored-by: liu <[email protected]>
Co-authored-by: liu <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>

* ci: 修改触发单元测试覆盖率的分支

old:main -> new:development

* ci: 兼容新版 vitest

vitest-dev/vitest#3339

* ci: 测试覆盖率前生成 banner

* test: 单元测试更新 (#28)

Co-authored-by: lyj <[email protected]>

* docs: readme update (#30)

Co-authored-by: wuhaoyuan <[email protected]>

* build: 使用 pnpm 替代 yarn (#31)

* feat: 异步加载文件成功提示信息 (#32)

Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: liu <[email protected]>

* feature: 更新 load 方法,并修改 vite 打包暴露的全局变量名称为 niUtils (#33)

* refactor: 修改默认暴露名称

* fix: 修改load的函数

---------

Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>

* feat: 补充单元测试并增加 e2e 相关测试 (#34)

* feat: 单元测试增加jsdom相关测试

* test: 添加 e2e 的测试并使用 eslint 重新格式化整个项目

* feat: 新增获取元素样式的值的函数

* test: 修复错误的 computedTextWidth 测试用例逻辑

* ci: 添加 cypress 的缓存

---------

Co-authored-by: lyj <[email protected]>
Co-authored-by: liunian <[email protected]>

---------

Co-authored-by: liunian <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: liu <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: 李彦杰 <[email protected]>
Co-authored-by: lyj <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>
liunnn1994 added a commit that referenced this pull request Jul 19, 2023
* publish (#38)

* ci: 新增 action 手动触发

* ci: 新增手动 action 提示

* chore(release): 1.1.0-beta.1 [skip ci]

# [1.1.0-beta.1](v1.0.0...v1.1.0-beta.1) (2023-06-14)

### Features

* 添加文档搜索功能 ([#24](#24)) ([9248fb6](9248fb6))

* docs: update README.md (#17)

* feat: 计算文字宽度

✅ Closes: #15

* chore(release): 1.0.0-development.1 [skip ci]

# 1.0.0-development.1 (2023-05-25)

### Features

* 清除历史日志,项目迁移 ([5ec0f43](5ec0f43))
* 计算文字宽度 ([b916185](b916185)), closes [#15](#15)
* 重置版本号 ([55def4a](55def4a))

* docs: update README.md

---------

Co-authored-by: liu <[email protected]>
Co-authored-by: liu <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>

* ci: 修改触发单元测试覆盖率的分支

old:main -> new:development

* ci: 兼容新版 vitest

vitest-dev/vitest#3339

* ci: 测试覆盖率前生成 banner

* test: 单元测试更新 (#28)

Co-authored-by: lyj <[email protected]>

* docs: readme update (#30)

Co-authored-by: wuhaoyuan <[email protected]>

* build: 使用 pnpm 替代 yarn (#31)

* feat: 异步加载文件成功提示信息 (#32)

Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: liu <[email protected]>

* feature: 更新 load 方法,并修改 vite 打包暴露的全局变量名称为 niUtils (#33)

* refactor: 修改默认暴露名称

* fix: 修改load的函数

---------

Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>

* feat: 补充单元测试并增加 e2e 相关测试 (#34)

* feat: 单元测试增加jsdom相关测试

* test: 添加 e2e 的测试并使用 eslint 重新格式化整个项目

* feat: 新增获取元素样式的值的函数

* test: 修复错误的 computedTextWidth 测试用例逻辑

* ci: 添加 cypress 的缓存

---------

Co-authored-by: lyj <[email protected]>
Co-authored-by: liunian <[email protected]>

---------

Co-authored-by: liunian <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: liu <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: 李彦杰 <[email protected]>
Co-authored-by: lyj <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>

* feat: 修改 keywords

* chore(release): 1.1.0 [skip ci]

# [1.1.0](v1.0.0...v1.1.0) (2023-07-19)

### Features

* 修改 keywords ([11c4e02](11c4e02))
* 添加文档搜索功能 ([#24](#24)) ([9248fb6](9248fb6))

* fix: 修复 preinstall 导致的错误

---------

Co-authored-by: alanwhy <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: liu <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>
Co-authored-by: 李彦杰 <[email protected]>
Co-authored-by: lyj <[email protected]>
Co-authored-by: wuhaoyuan <[email protected]>
ni-team-bot pushed a commit that referenced this pull request Jul 19, 2023
# [1.2.0](v1.1.0...v1.2.0) (2023-07-19)

### Features

* 异步加载文件成功提示信息 ([#32](#32)) ([aaac067](aaac067))
* 补充单元测试并增加 e2e 相关测试 ([#34](#34)) ([0a1c5ed](0a1c5ed))
@ni-team-bot
Copy link
Member

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

与浏览器相关的测试用例应使用 e2e 框架
5 participants