mirror of
https://github.com/appium/appium.git
synced 2026-10-24 01:28:55 +08:00
2781805c05
* chore: ban direct usage of sinon Calling `sinon.stub()`, `sinon.mock()` etc., directly is error-prone. Care must be taken to explicitly restore any stub created. Using a sandbox (via `sinon.createSandbox()`), you don't need to remember to restore everything you fiddled with. To that end, I've converted all direct `sinon` calls into sandbox calls and **BANNED** direct usage of `sinon` via ESLint. # Conflicts: # .eslintrc * test(base-driver): replace restricted sinon.spy() usage in server-specs.js * test(support): formatting
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
{
|
|
"extends": "@appium/eslint-config-appium",
|
|
"overrides": [
|
|
{
|
|
"files": "packages/fake-driver/**/*",
|
|
"rules": { "require-await": "off" }
|
|
},
|
|
{ "files": "packages/support/**/*", "globals": { "BigInt": "readonly" } },
|
|
{
|
|
"files": "packages/*/test/**/*",
|
|
"rules": { "func-names": "off" }
|
|
},
|
|
{
|
|
"files": "./packages/*/scripts/**/*.js",
|
|
"parserOptions": {
|
|
"sourceType": "script"
|
|
}
|
|
},
|
|
{
|
|
"files": "./packages/*/test/**/*.js",
|
|
"rules": {
|
|
"no-restricted-properties": [
|
|
"error",
|
|
{
|
|
"object": "sinon",
|
|
"property": "spy",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.spy()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "stub",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.stub()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
},
|
|
{
|
|
"object": "sinon",
|
|
"property": "mock",
|
|
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.mock()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|