From 5051bf1b10bc6a9158e6b99cb06f067b3f474440 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 31 Oct 2019 08:11:46 -0400 Subject: [PATCH] Fix lint (#723) * adjust eslint config * run prettier * limit cypress run * add all cypress files --- .eslintrc.json | 5 ++++- .github/workflows/cypress.yml | 20 +++++++++++++++----- cypress/plugins/index.js | 2 +- cypress/support/index.js | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e392363..1eabf5a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -69,8 +69,11 @@ } }, { - "files": ["cypress/**/*.spec.js"], + "files": ["cypress/**"], "plugins": ["cypress"], + "rules": { + "no-unused-vars": "warn" + }, "env": { "cypress/globals": true } diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index ac9f175..50d19cf 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -1,6 +1,16 @@ name: Cypress -on: [pull_request] +on: + pull_request: + paths: + - 'src/**' + - 'package-lock.json' + - '.browserslistrc' + - '.babelrc' + - 'webpack.config.*' + - 'public/test/**' + - 'cypress/**' + - '.github/workflows/cypress.yml' jobs: test-e2e: @@ -20,13 +30,13 @@ jobs: env: HUSKY_SKIP_INSTALL: true - - name: run Cypress - run: npx run-p --race start cypress:run + - name: run Cypress CI + run: npx run-p --race start cypress:ci env: CI: true + TERM: xterm-256color CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} DEBUG: commit-info,cypress:server:record # https://docs.cypress.io/guides/guides/continuous-integration.html#Environment-variables COMMIT_INFO_BRANCH: ${{ github.head_ref }} - COMMIT_INFO_AUTHOR: ${{ github.event.sender.login }} - COMMIT_INFO_SHA: ${{ github.event.after }} + NODE_ENV: production # prevent watching diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index fd170fb..dffed25 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -14,4 +14,4 @@ module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config -} +}; diff --git a/cypress/support/index.js b/cypress/support/index.js index d68db96..37a498f 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands')