-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Develop #4181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Develop #4181
Changes from all commits
aec92cc
9cd525f
901e2df
bd4892f
f192834
c875dce
4a6f248
6cdbb3a
a15be9a
8fe252d
dbb5c23
aec7db9
6b0af0b
31b42cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| module.exports = { | ||
| env: { | ||
| browser: true, | ||
| es2024: true, | ||
| }, | ||
| extends: [ | ||
| 'standard', | ||
| 'plugin:react/recommended', | ||
| 'airbnb', | ||
| 'plugin:prettier/recommended', | ||
| 'plugin:cypress/recommended', | ||
| ], | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| }, | ||
| plugins: ['jsx-a11y', 'import', 'react', 'prettier'], | ||
| rules: { | ||
| 'function-paren-newline': ['error', 'consistent'], | ||
| 'comma-dangle': [ | ||
| 'error', | ||
| { | ||
| arrays: 'always-multiline', | ||
| objects: 'always-multiline', | ||
| imports: 'always-multiline', | ||
| exports: 'always-multiline', | ||
| functions: 'always-multiline', | ||
| }, | ||
| ], | ||
| indent: [ | ||
| 'error', | ||
| 2, | ||
| { | ||
| SwitchCase: 1, | ||
| VariableDeclarator: 1, | ||
| outerIIFEBody: 1, | ||
| // MemberExpression: null, | ||
| FunctionDeclaration: { | ||
| parameters: 1, | ||
| body: 1, | ||
| }, | ||
| FunctionExpression: { | ||
| parameters: 1, | ||
| body: 1, | ||
| }, | ||
| CallExpression: { | ||
| arguments: 1, | ||
| }, | ||
| ArrayExpression: 1, | ||
| ObjectExpression: 1, | ||
| ImportDeclaration: 1, | ||
| flatTernaryExpressions: false, | ||
| // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js | ||
| ignoredNodes: [ | ||
| 'JSXElement', | ||
| 'JSXElement > *', | ||
| 'JSXAttribute', | ||
| 'JSXIdentifier', | ||
| 'JSXNamespacedName', | ||
| 'JSXMemberExpression', | ||
| 'JSXSpreadAttribute', | ||
| 'JSXExpressionContainer', | ||
| 'JSXOpeningElement', | ||
| 'JSXClosingElement', | ||
| 'JSXFragment', | ||
| 'JSXOpeningFragment', | ||
| 'JSXClosingFragment', | ||
| 'JSXText', | ||
| 'JSXEmptyExpression', | ||
| 'JSXSpreadChild', | ||
| ], | ||
| ignoreComments: false, | ||
| }, | ||
| ], | ||
| 'no-unused-expressions': [ | ||
| 'error', | ||
| { | ||
| allowShortCircuit: false, | ||
| allowTernary: false, | ||
| allowTaggedTemplates: false, | ||
| }, | ||
| ], | ||
| 'jsx-a11y/label-has-for': [ | ||
| 2, | ||
| { | ||
| components: ['Label'], | ||
| required: { | ||
| some: ['id', 'nesting'], | ||
| }, | ||
| allowChildren: true, | ||
| }, | ||
| ], | ||
| 'jsx-a11y/label-has-associated-control': [2, { assert: 'either' }], | ||
| 'jsx-a11y/control-has-associated-label': 'off', | ||
| 'implicit-arrow-linebreak': 0, | ||
| 'import/prefer-default-export': 0, | ||
| 'import/no-extraneous-dependencies': [ | ||
| 'error', | ||
| { | ||
| devDependencies: true, | ||
| optionalDependencies: false, | ||
| peerDependencies: false, | ||
| }, | ||
| ], | ||
| 'max-len': [ | ||
| 'error', | ||
| { | ||
| ignoreTemplateLiterals: true, | ||
| ignoreComments: true, | ||
| }, | ||
| ], | ||
| 'no-console': 'error', | ||
| 'no-param-reassign': [2, { props: true }], | ||
| 'no-shadow': ['error', { builtinGlobals: false }], | ||
| 'padding-line-between-statements': [ | ||
| 'error', | ||
| { blankLine: 'always', prev: '*', next: 'return' }, | ||
| { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' }, | ||
| { | ||
| blankLine: 'any', | ||
| prev: ['const', 'let', 'var'], | ||
| next: ['const', 'let', 'var'], | ||
| }, | ||
| { blankLine: 'always', prev: 'directive', next: '*' }, | ||
| { blankLine: 'always', prev: 'block-like', next: '*' }, | ||
| ], | ||
| 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], | ||
| 'react/prop-types': 0, | ||
| 'react/react-in-jsx-scope': 0, | ||
| 'react/destructuring-assignment': 0, | ||
| 'react/function-component-definition': 0, | ||
| }, | ||
| }; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,19 +11,21 @@ jobs: | |
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [14.x] | ||
| node-version: [20.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| # fix rollup issue | ||
| - run: rm -rf node_modules package-lock.json | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line, combined with the next one, is not ideal for a CI environment. Deleting Consider replacing this line and the next with a single |
||
| - run: npm install | ||
|
Comment on lines
+23
to
24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a more reliable and faster build in a CI environment, it's highly recommended to use You can replace these two lines with a single command: |
||
| - run: npm test -- -l | ||
| - name: Upload tests report(cypress mochaawesome merged HTML report) | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@v2 | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: report | ||
| path: reports | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /node_modules | ||
| /build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "arrowParens": "avoid", | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "trailingComma": "all", | ||
| "jsxSingleQuote": false, | ||
| "printWidth": 80, | ||
| "semi": true, | ||
| "bracketSpacing": true, | ||
| "bracketSameLine": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const { defineConfig } = require('cypress'); | ||
|
|
||
| module.exports = defineConfig({ | ||
| e2e: { | ||
| baseUrl: 'http://localhost:3000', | ||
| specPattern: 'cypress/integration/**/*.spec.{js,ts,jsx,tsx}', | ||
| }, | ||
| video: true, | ||
| viewportHeight: 1920, | ||
| viewportWidth: 1080, | ||
| screenshotOnRunFailure: true, | ||
| reporter: 'mochawesome', | ||
| reporterOptions: { | ||
| reportDir: 'raw_reports', | ||
| overwrite: false, | ||
| html: false, | ||
| json: true, | ||
| }, | ||
| component: { | ||
| specPattern: 'src/**/*.spec.{js,ts,jsx,tsx}', | ||
| devServer: { | ||
| framework: 'react', | ||
| bundler: 'vite', | ||
| }, | ||
| }, | ||
| }); |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| describe('Page', () => { | ||
| before(() => { | ||
| beforeEach(() => { | ||
| cy.visit('/'); | ||
| }); | ||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // *********************************************** | ||
| // This example commands.ts shows you how to | ||
| // create various custom commands and overwrite | ||
| // existing commands. | ||
| // | ||
| // For more comprehensive examples of custom | ||
| // commands please read more here: | ||
| // https://on.cypress.io/custom-commands | ||
| // *********************************************** | ||
| // | ||
| // | ||
| // -- This is a parent command -- | ||
| // Cypress.Commands.add('login', (email, password) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a child command -- | ||
| // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This is a dual command -- | ||
| // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
| // | ||
| // | ||
| // -- This will overwrite an existing command -- | ||
| // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
| // | ||
| // declare global { | ||
| // namespace Cypress { | ||
| // interface Chainable { | ||
| // login(email: string, password: string): Chainable<void> | ||
| // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
| // } | ||
| // } | ||
| // } | ||
|
|
||
| export {}; | ||
|
|
||
| Cypress.Commands.add('getByDataCy', selector => { | ||
| cy.get(`[data-cy="${selector}"]`); | ||
| }); | ||
|
|
||
| Cypress.Commands.add( | ||
| 'byDataCy', | ||
| { prevSubject: 'optional' }, | ||
|
|
||
| (subject, name) => { | ||
| const selector = `[data-cy="${name}"]`; | ||
|
|
||
| return subject ? cy.wrap(subject).find(selector) : cy.get(selector); | ||
| }, | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
| <title>Components App</title> | ||
| </head> | ||
| <body> | ||
| <div data-cy-root></div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // *********************************************************** | ||
| // This example support/component.ts is processed and | ||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
|
|
||
| // Import commands.js using ES2015 syntax: | ||
| import './commands'; | ||
|
|
||
| // Alternatively you can use CommonJS syntax: | ||
| // require('./commands') | ||
|
|
||
| import { mount } from 'cypress/react18'; | ||
|
|
||
| // Augment the Cypress namespace to include type definitions for | ||
| // your custom command. | ||
| // Alternatively, can be defined in cypress/support/component.d.ts | ||
| // with a <reference path="./component" /> at the top of your spec. | ||
|
|
||
| Cypress.Commands.add('mount', mount); | ||
|
|
||
| // Example use: | ||
| // cy.mount(<MyComponent />) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // *********************************************************** | ||
| // This example support/e2e.ts is processed and | ||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
|
|
||
| // Import commands.js using ES2015 syntax: | ||
| import './commands'; | ||
|
|
||
| // Alternatively you can use CommonJS syntax: | ||
| // require('./commands') |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting the
package-lock.jsonfile before installing dependencies is not a recommended practice for CI environments. This makes your build non-reproducible, as it might install different versions of sub-dependencies. For faster and more reliable installs that respect the lock file, consider usingnpm ciinstead.