新增: - backend/venv/ - Python 虚拟环境 - backend/start.sh - 启动脚本(使用虚拟环境) - backend/requirements.txt - 依赖列表 - .gitignore - 忽略虚拟环境和缓存文件 说明: - 每个项目使用独立虚拟环境 - 避免依赖冲突 - 启动脚本自动创建和激活虚拟环境
1.1 KiB
1.1 KiB
Disallow specific matchers & modifiers (no-restricted-matchers)
This rule bans specific matchers & modifiers from being used, and can suggest alternatives.
Rule Details
Bans are expressed in the form of a map, with the value being either a string
message to be shown, or null if the default rule message should be used.
Both matchers, modifiers, and chains of the two are checked, allowing for specific variations of a matcher to be banned if desired.
By default, this map is empty, meaning no matchers or modifiers are banned.
For example:
{
"jest/no-restricted-matchers": [
"error",
{
"toBeFalsy": null,
"resolves": "Use `expect(await promise)` instead.",
"not.toHaveBeenCalledWith": null
}
]
}
Examples of incorrect code for this rule with the above configuration
it('is false', () => {
expect(a).toBeFalsy();
});
it('resolves', async () => {
await expect(myPromise()).resolves.toBe(true);
});
describe('when an error happens', () => {
it('does not upload the file', async () => {
expect(uploadFileMock).not.toHaveBeenCalledWith('file.name');
});
});