Ajoute des règles de linting pour les tests Mocha

J'ai involontairement mergé un `it.only` dans #1136 qui désactive tous
les tests sauf un — utile en développement mais pas quelque chose que
l'on veut commiter sur `master`. La règle Eslint bloquera désormais ce
code.
pull/1161/head
Maxime Quandalle 2020-10-12 14:23:18 +02:00
parent b3e5ef71d3
commit 753daccac9
4 changed files with 18 additions and 6 deletions

View File

@ -16,7 +16,8 @@ module.exports = {
},
plugins: [
"react",
"react-hooks"
"react-hooks",
"mocha"
],
rules: {
"quotes": [
@ -38,7 +39,9 @@ module.exports = {
"react/no-unescaped-entities": 0,
"react/display-name": 1,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
"react-hooks/exhaustive-deps": "warn",
"mocha/no-skipped-tests": "warn",
"mocha/no-exclusive-tests": "error"
},
settings: {
"react": {
@ -90,7 +93,7 @@ module.exports = {
]
},
{
files: [ "**/*.test.js" ],
files: ["**/*.test.js"],
env: {
mocha: true
}

View File

@ -144,7 +144,7 @@ describe('Simulateur salarié', () => {
cy.contains('Steenvoorde (59114)')
})
it.only('should permit selecting the smic before part-time contrat', function() {
it('should permit selecting the smic before part-time contrat', function() {
cy.get('input[name$="brut de base"').click()
cy.get('button')
.contains('SMIC')

View File

@ -60,6 +60,7 @@
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^2.0.1",
"express": "^4.16.3",

View File

@ -4765,6 +4765,14 @@ eslint-config-prettier@^4.0.0:
dependencies:
get-stdin "^6.0.0"
eslint-plugin-mocha@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-8.0.0.tgz#7ec5d228bcb3735301701dfbc3376320a1ca3791"
integrity sha512-n67etbWDz6NQM+HnTwZHyBwz/bLlYPOxUbw7bPuCyFujv7ZpaT/Vn6KTAbT02gf7nRljtYIjWcTxK/n8a57rQQ==
dependencies:
eslint-utils "^2.1.0"
ramda "^0.27.1"
eslint-plugin-react-hooks@^2.0.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.5.1.tgz#4ef5930592588ce171abeb26f400c7fbcbc23cd0"
@ -4818,7 +4826,7 @@ eslint-utils@^1.4.3:
dependencies:
eslint-visitor-keys "^1.1.0"
eslint-utils@^2.0.0:
eslint-utils@^2.0.0, eslint-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
@ -9878,7 +9886,7 @@ ramda@^0.26.1:
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06"
integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==
ramda@^0.27, ramda@^0.27.0:
ramda@^0.27, ramda@^0.27.0, ramda@^0.27.1:
version "0.27.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9"
integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==