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

test: accompany unit test suites with key code #25

Open
Symbolk opened this issue Jun 24, 2021 · 0 comments
Open

test: accompany unit test suites with key code #25

Symbolk opened this issue Jun 24, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Symbolk
Copy link
Owner

Symbolk commented Jun 24, 2021

目标:搭建单元测试框架,为后续关键算法改进开发配套测试代码
分支:test

首先全局安装mocha:

yarn global add mocha

测试代码:https://github.com/Symbolk/somanyconflicts/blob/test/src/test/AlgUtils.test.ts

命令行执行:

mocha -r ts-node/register ./src/test/*.test.ts

但遇到如下错误(因为test中依赖的Conflict依赖vscode):

Error: Cannot find module 'vscode'
Require stack:
- /Users/symbolk/coding/vscode/somanyconflicts/src/Conflict.ts
- /Users/symbolk/coding/vscode/somanyconflicts/src/test/AlgUtils.test.ts
- /Users/symbolk/.nvm/versions/node/v14.16.0/lib/node_modules/mocha/lib/esm-utils.js
- /Users/symbolk/.nvm/versions/node/v14.16.0/lib/node_modules/mocha/lib/mocha.js
- /Users/symbolk/.nvm/versions/node/v14.16.0/lib/node_modules/mocha/lib/cl
@Symbolk Symbolk added the enhancement New feature or request label Jun 24, 2021
@Symbolk Symbolk changed the title Accompany unit test suites with key code test: accompany unit test suites with key code Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants