
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@tool-developer/wx-unit
Advanced tools
微信小程序单元测试工具包。
npm install --save-dev @tool-developer/wx-unit
or
yarn add -D @tool-developer/wx-unit
import unit from '@tool-developer/wx-unit'
npm init
package.json
"scripts": {
"test": "jest"
},
npm install -g jest
npm install -D jest babel-jest babel-core @babel/preset-env @tool-developer/wx-unit
babel.config.js
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]]
};
jest --init
jest.config.js
"verbose":true,
"testEnvironment": "node",
//测试前先启动环境依赖文件
"setupFiles":['./test.js'],
//需要编译node_modules时配置
"transformIgnorePatterns": [
],
//单测覆盖
"coverageDirectory": "coverage",
//单测覆盖忽略文件
"coveragePathIgnorePatterns": [
"./test.js"
],
//测试路径忽略文件
"testPathIgnorePatterns": [
"./test.js"
],
import unit from '@tool-developer/wx-unit';
export default unit;
编写单元测试文件,具体参考jest document
运行
npm run test
FAQs
wx miniprogram unit test
We found that @tool-developer/wx-unit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.