
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@cs-magic/jest-config
Advanced tools
CS Magic 项目的共享 Jest 配置。
npm install --save-dev @cs-magic/jest-config
// jest.config.js
module.exports = require('@cs-magic/jest-config')
// jest.config.js
module.exports = require('@cs-magic/jest-config/presets/react')
// jest.config.js
module.exports = require('@cs-magic/jest-config/presets/next')
// jest.config.js
const baseConfig = require('@cs-magic/jest-config/presets/react')
module.exports = {
...baseConfig,
// 你的自定义配置
testTimeout: 10000,
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
}
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { MyComponent } from './MyComponent'
describe('MyComponent', () => {
it('renders correctly', () => {
render(<MyComponent />)
expect(screen.getByRole('button')).toBeInTheDocument()
})
})
在 package.json 中添加:
{
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
}
}
修改超时时间:
module.exports = {
...require('@cs-magic/jest-config'),
testTimeout: 10000,
}
jest.mock('./myModule', () => ({
myFunction: jest.fn(),
}))
module.exports = {
...require('@cs-magic/jest-config'),
transform: {
'^.+\\.mdx?$': '@mdx-js/jest-transformer',
},
}
FAQs
Shared Jest configurations for CS Magic projects
The npm package @cs-magic/jest-config receives a total of 1 weekly downloads. As such, @cs-magic/jest-config popularity was classified as not popular.
We found that @cs-magic/jest-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.