
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@darcytech/jest-preset-darcytech
Advanced tools
@darcytech/jest-preset-darcytechjest 的基础、可共享配置。
npm i --save-dev @darcytech/jest-preset-darcytech jest
//jest-config.js
module.exports = {
preset: '@darcytech/jest-preset-darcytech',
};
可能是缓存的问题。运行测试可以加上 --no-cache 。配置好 jest 后,记得将 --no-cache 去掉,因为这会影响测试性能。如果想要删除缓存,可以参考--clearCache。
内部使用了 @swc/jest ,mock api 时,需要将 mock 的代码写到另一个文件,并在测试文件顶部引入。
// mock.ts
import { jest } from '@jest/globals';
jest.mock('apis/taskAutoAssignApi');
jest.mock('apis/taskTemplateApi');
// a.test.ts
import 'mock';
// 其他代码
FAQs
jest 基础可共享配置
We found that @darcytech/jest-preset-darcytech 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
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.