Skip to content

Commit

Permalink
fix: lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 24, 2024
1 parent 9d4ff46 commit 5453f35
Show file tree
Hide file tree
Showing 11 changed files with 632 additions and 500 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm i && npx playwright install chromium
- run: npm run lint
- run: npm test
17 changes: 17 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}
30 changes: 15 additions & 15 deletions constants/codeceptjsTypes.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
const screenshotHelpers = [
'WebDriver',
'Appium',
'Puppeteer',
'TestCafe',
'Playwright',
'WebDriver',
'Appium',
'Puppeteer',
'TestCafe',
'Playwright',
];

const PREFIX_PASSED_TEST = '✅ [TEST]';
const PREFIX_FAILED_TEST = '❌ [TEST]';
const PREFIX_SKIPPED_TEST = '⏩ [SKIPPED TEST]'
const PREFIX_SKIPPED_TEST = '⏩ [SKIPPED TEST]';
const PREFIX_PASSED_STEP = '✅ [STEP]';
const PREFIX_FAILED_STEP = '❌ [STEP]';
const PREFIX_BUG = '🐞🐞 LOGS --->'
const PREFIX_BUG = '🐞🐞 LOGS --->';

module.exports = {
screenshotHelpers,
PREFIX_PASSED_TEST,
PREFIX_FAILED_TEST,
PREFIX_SKIPPED_TEST,
PREFIX_PASSED_STEP,
PREFIX_FAILED_STEP,
PREFIX_BUG
}
screenshotHelpers,
PREFIX_PASSED_TEST,
PREFIX_FAILED_TEST,
PREFIX_SKIPPED_TEST,
PREFIX_PASSED_STEP,
PREFIX_FAILED_STEP,
PREFIX_BUG,
};
10 changes: 5 additions & 5 deletions constants/launchModes.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const LAUNCH_MODES = {
DEFAULT: 'DEFAULT',
DEBUG: 'DEBUG',
}
DEFAULT: 'DEFAULT',
DEBUG: 'DEBUG',
};

module.exports = {
LAUNCH_MODES
}
LAUNCH_MODES,
};
18 changes: 9 additions & 9 deletions constants/logLevels.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const LOG_LEVELS = {
TRACE: 'TRACE',
DEBUG: 'DEBUG',
WARN: 'WARN',
INFO: 'INFO',
ERROR: 'ERROR',
FATAL: 'FATAL',
}
TRACE: 'TRACE',
DEBUG: 'DEBUG',
WARN: 'WARN',
INFO: 'INFO',
ERROR: 'ERROR',
FATAL: 'FATAL',
};

module.exports = {
LOG_LEVELS
}
LOG_LEVELS,
};
22 changes: 11 additions & 11 deletions constants/statuses.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const STATUSES = {
FAILED: 'failed',
PASSED: 'passed',
SKIPPED: 'skipped',
STOPPED: 'stopped',
INTERRUPTED: 'interrupted',
CANCELLED: 'cancelled',
INFO: 'info',
WARN: 'warn',
}
FAILED: 'failed',
PASSED: 'passed',
SKIPPED: 'skipped',
STOPPED: 'stopped',
INTERRUPTED: 'interrupted',
CANCELLED: 'cancelled',
INFO: 'info',
WARN: 'warn',
};

module.exports = {
STATUSES
}
STATUSES,
};
12 changes: 6 additions & 6 deletions constants/testItemTypes.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const TEST_ITEM_TYPES = {
SUITE: 'SUITE',
TEST: 'TEST',
STEP: 'STEP',
}
SUITE: 'SUITE',
TEST: 'TEST',
STEP: 'STEP',
};

module.exports = {
TEST_ITEM_TYPES
}
TEST_ITEM_TYPES,
};
62 changes: 31 additions & 31 deletions helpers/restClient.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
const axios = require('axios').default;

class RestClient {
constructor() {
this.axios = axios.create();
}
constructor() {
this.axios = axios.create();
}

async makePostRequest (url, payload = {}, headers = {}) {
try {
return this.axios.post(url, payload, { headers });
} catch (e) {
throw new Error(e.message);
}
}
async makePostRequest(url, payload = {}, headers = {}) {
try {
return this.axios.post(url, payload, { headers });
} catch (e) {
throw new Error(e.message);
}
}

async makePutRequest (url, payload = {}, headers = {}) {
try {
return this.axios.put(url, payload, { headers });
} catch (e) {
throw new Error(e.message);
}
}
async makePutRequest(url, payload = {}, headers = {}) {
try {
return this.axios.put(url, payload, { headers });
} catch (e) {
throw new Error(e.message);
}
}

async makeGetRequest(url, headers = {}) {
try {
return this.axios.get(url, { headers });
} catch (e) {
throw new Error(e.message);
}
}
async makeGetRequest(url, headers = {}) {
try {
return this.axios.get(url, { headers });
} catch (e) {
throw new Error(e.message);
}
}

async makeDeleteRequest(url, headers = {}) {
try {
return this.axios.delete(url, { headers });
} catch (e) {
throw new Error(e.message);
}
}
async makeDeleteRequest(url, headers = {}) {
try {
return this.axios.delete(url, { headers });
} catch (e) {
throw new Error(e.message);
}
}
}

module.exports = RestClient;
Loading

0 comments on commit 5453f35

Please sign in to comment.