Skip to content

Commit

Permalink
Merge pull request #97 from Exabyte-io/feat/SOF-6399-1
Browse files Browse the repository at this point in the history
SOF-6399-1: reformat eslint issues
  • Loading branch information
unsigned6 committed Nov 22, 2022
2 parents 84b22f2 + 4cf889d commit 0632a30
Show file tree
Hide file tree
Showing 60 changed files with 782 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
}
],
"@babel/preset-react",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:

run-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout this repository
Expand All @@ -25,15 +25,17 @@ jobs:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

- name: Validate JS package
uses: ./actions/js/validate
with:
node-version: 12.21.x

- name: Docker build and test
uses: ./.github/workflows/docker-build-test
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ECR }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ECR }}

- name: Validate JS package
uses: ./actions/js/validate

- name: Validate app dockerfile
uses: ./actions/docker/validate
with:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/cucumber/fixtures/*.json
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": false,
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 4
}
69 changes: 62 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"transpile-tests": "babel --presets @babel/preset-env --out-dir dist/tests/cucumber tests/cucumber",
"transpile": "babel --out-dir dist src; node-sass -r src/stylesheets -o dist/stylesheets",
"test": "bash run-tests.sh",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint": "eslint src tests && prettier --write src tests",
"lint:fix": "eslint src tests --fix && prettier --write src tests",
"postinstall": "npm run transpile",
"prettier": "prettier --check src tests",
"prepare": "husky install"
},
"repository": {
Expand All @@ -32,7 +33,6 @@
"@babel/preset-react": "7.16.7",
"@babel/runtime": "7.16.7",
"@babel/runtime-corejs2": "7.16.7",
"@exabyte-io/eslint-config": "^2022.11.16-0",
"@exabyte-io/wave.js": "2022.10.13-0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
Expand Down Expand Up @@ -66,14 +66,19 @@
"react-dom": "^16.14.0"
},
"devDependencies": {
"@exabyte-io/eslint-config": "^2022.11.17-0",
"@exabyte-io/made.js": "2022.5.5-3",
"babel-eslint": "^10.1.0",
"babel-preset-react-app": "^9.1.2",
"cross-env": "^7.0.3",
"eslint": "7.32.0",
"eslint-config-airbnb": "19.0.2",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-exports": "^1.0.0-beta.3",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jsdoc": "37.1.0",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.27.1",
"eslint-plugin-simple-import-sort": "7.0.0",
"husky": "7.0.4",
Expand All @@ -84,7 +89,8 @@
"react-error-overlay": "^6.0.9"
},
"lint-staged": {
"*.{js,jsx}": "eslint --cache --fix"
"*.{js,jsx}": "eslint --cache --fix",
"*.{js,jsx,css}": "prettier --write"
},
"resolutions": {
"react-error-overlay": "6.0.9"
Expand Down
13 changes: 13 additions & 0 deletions tests/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["@exabyte-io/eslint-config"],
"parser": "babel-eslint",
"globals": {
"exabrowser": "readonly",
"browser": "readonly",
"$": "readonly"
},
"rules": {
"func-names": "off",
"radix": "off"
}
}
17 changes: 9 additions & 8 deletions tests/cucumber/support/hooks.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import {SETTINGS} from "./settings";
import {initializeExaBrowserHook} from "./utils/exabrowser";
import { SETTINGS } from "./settings";
import { initializeExaBrowserHook } from "./utils/exabrowser";

var isFeatureStarted = false;
let isFeatureStarted = false;

/**
* @summary Sets browser size to minimal resolution.
*/
function setViewportSizeHook() {exabrowser.setViewportSize(SETTINGS.VIEWPORT_SIZE)}
function setViewportSizeHook() {
exabrowser.setViewportSize(SETTINGS.VIEWPORT_SIZE);
}

/*
* Hooks are run Before/After each scenario
*/
export default function () {
this.Before(function () {
this.Before(() => {
if (!isFeatureStarted) {
initializeExaBrowserHook(); // KEEP THIS FIRST!
setViewportSizeHook();
}
isFeatureStarted = true;
});

this.After(function () {
})
};
this.After(() => {});
}
7 changes: 4 additions & 3 deletions tests/cucumber/support/logger.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import debug from "debug";

const LEVELS = {
debug: 3,
warn: 2,
info: 1,
error: 0
error: 0,
};

const DEBUG_LEVEL = process.env.DEBUG_LEVEL || LEVELS.warn;
Expand Down Expand Up @@ -36,8 +37,8 @@ export function getLogger(name) {
if (DEBUG_LEVEL >= LEVELS.error) {
log(message);
}
}
}
},
};
}

export const logger = getLogger("exachimp:default");
9 changes: 5 additions & 4 deletions tests/cucumber/support/page.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {Widget} from "./widget";
import { Widget } from "./widget";

/**
* http://webdriver.io/guide/testrunner/pageobjects.html.
*/
export class Page extends Widget {

/**
* @summary Opens the page.
*/
Expand All @@ -14,6 +13,8 @@ export class Page extends Widget {
this.waitForLoaderToDisappear();
}

getUrl() {return exabrowser.getUrl()}

// eslint-disable-next-line class-methods-use-this
getUrl() {
return exabrowser.getUrl();
}
}
Loading

0 comments on commit 0632a30

Please sign in to comment.