Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@tuchuang.space/mock-server
Advanced tools
一个 server 模拟工具, 可配置响应, 提供接口获取某个请求的详细数据
在 IE 11 中使用 selenium 测试 ctrl+v 粘贴功能的时候, 没有找到 spies 测试法来测试浏览器是否真正的发起了请求并且传入了合适的参数, 所以采用 mock 测试法, 这里的 mock-server 监听所有来临的请求并且提供接口查询该 mock-server 接收到的请求
const mockServer = require('mock-server')
describe('某个功能', () => {
beforeAll(async () => {
await mockServer.start()
})
afterAll(async () => {
await mockServer.stop()
})
it('发起 /api/v1/image 请求, 并且带上图片数据', async () => {
// arrange
// act
ctrl+vAction()
// assert
await new Promise((resolve) => setTimeout(resolve, 2000))
const data = mockServer.search({ path: '/api/v1/image', method: 'POST' })
expect(data[0].request.query).toEqual({ foo: 1, bar: 2 })
})
})
该项目处于 MVP(Minimum Viable Product) 开发阶段, 如果想了解 MVP 阶段会提供什么功能, 查看 MVP milestone
FAQs
一个 server 模拟工具, 可配置响应, 获取某个请求是否接收到了
We found that @tuchuang.space/mock-server 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.