Skip to content

Commit 903191f

Browse files
authored
fix(ci): enable lint check (#136)
* fix(ci): enable lint check * fix: GHA * fix: lint issue
1 parent 14568fa commit 903191f

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
run: |
2828
npm i && npx playwright install chromium
2929
npm test
30+
- name: lint check
31+
run: |
32+
npm i
33+
npm run lint
3034
- name: Build
3135
run: |
3236
npm i

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "tsc",
1111
"lint": "rome ci src",
1212
"format": "rome format src --write",
13-
"lint:fix": "rome check src --apply-suggested",
13+
"lint:fix": "rome check src --apply-unsafe",
1414
"test": "jest --coverage"
1515
},
1616
"dependencies": {

src/index.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { Helper } = require('codeceptjs');
1+
const { Helper } = require("codeceptjs");
22
const resemble = require("resemblejs");
33
const fs = require("fs");
44
const assert = require("assert");
@@ -30,7 +30,7 @@ interface Options {
3030
needsSameDimension?: boolean;
3131
outputSettings?: any;
3232
prepareBaseImage?: boolean;
33-
compareWithImage?: any
33+
compareWithImage?: any;
3434
}
3535

3636
interface Endpoint {
@@ -69,7 +69,7 @@ class ResembleHelper extends Helper {
6969
outputDir = require("codeceptjs").config.get().output || "output";
7070
this.baseFolder = this.resolvePath(config.baseFolder);
7171
this.diffFolder = this.resolvePath(config.diffFolder);
72-
this.screenshotFolder = this.resolvePath(config.screenshotFolder || 'output');
72+
this.screenshotFolder = this.resolvePath(config.screenshotFolder || "output");
7373
this.prepareBaseImage = config.prepareBaseImage;
7474
}
7575

@@ -230,7 +230,7 @@ class ResembleHelper extends Helper {
230230
*/
231231

232232
async _addAttachment(baseImage: any, misMatch: any, options: Options) {
233-
const allure: any = require('codeceptjs').container.plugins("allure");
233+
const allure: any = require("codeceptjs").container.plugins("allure");
234234

235235
if (allure !== undefined && misMatch >= options.tolerance) {
236236
allure.addAttachment("Base Image", fs.readFileSync(this._getBaseImagePath(baseImage, options)), "image/png");
@@ -559,25 +559,25 @@ class ResembleHelper extends Helper {
559559
}
560560

561561
_getHelper() {
562-
if (this.helpers['Puppeteer']) {
563-
return this.helpers['Puppeteer'];
562+
if (this.helpers["Puppeteer"]) {
563+
return this.helpers["Puppeteer"];
564564
}
565565

566-
if (this.helpers['WebDriver']) {
567-
return this.helpers['WebDriver'];
566+
if (this.helpers["WebDriver"]) {
567+
return this.helpers["WebDriver"];
568568
}
569-
if (this.helpers['Appium']) {
570-
return this.helpers['Appium'];
569+
if (this.helpers["Appium"]) {
570+
return this.helpers["Appium"];
571571
}
572-
if (this.helpers['WebDriverIO']) {
573-
return this.helpers['WebDriverIO'];
572+
if (this.helpers["WebDriverIO"]) {
573+
return this.helpers["WebDriverIO"];
574574
}
575-
if (this.helpers['TestCafe']) {
576-
return this.helpers['TestCafe'];
575+
if (this.helpers["TestCafe"]) {
576+
return this.helpers["TestCafe"];
577577
}
578578

579-
if (this.helpers['Playwright']) {
580-
return this.helpers['Playwright'];
579+
if (this.helpers["Playwright"]) {
580+
return this.helpers["Playwright"];
581581
}
582582

583583
throw Error(`No matching helper found. Supported helpers: ${supportedHelper.join("/")}`);

0 commit comments

Comments
 (0)