Skip to content

Commit bfa9419

Browse files
author
Illia Obukhau
committed
chore(run-e2e): add prettier
1 parent cb67ac9 commit bfa9419

File tree

8 files changed

+43
-38
lines changed

8 files changed

+43
-38
lines changed

automation/run-e2e/.eslintrc.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ module.exports = {
22
root: true,
33
env: {
44
node: true,
5-
es2021: true,
5+
es2021: true
66
},
77
extends: ["eslint:recommended", "plugin:cypress/recommended"],
88
parserOptions: {
99
sourceType: "module",
1010
ecmaVersion: 2021
1111
}
12-
1312
};

automation/run-e2e/.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("../../prettier.config");

automation/run-e2e/bin/run-e2e.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { ci } from "../lib/ci.mjs";
55
import { dev } from "../lib/dev.mjs";
66

77
async function main() {
8-
const { _: [command] } = parseArgs(process.argv.slice(2))
8+
const {
9+
_: [command]
10+
} = parseArgs(process.argv.slice(2));
911

1012
switch (command) {
1113
case "ci": {

automation/run-e2e/lib/docker-utils.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@ export function startCypress(ip, freePort) {
168168
const command = [`docker run`, ...args].join(" ");
169169

170170
execSync(command, { stdio: "inherit" });
171-
}
171+
}

automation/run-e2e/lib/setup-test-project.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ async function updateAtlas() {
9999
} else {
100100
throw new Error("Can't fetch latest StarterApp release");
101101
}
102-
}
102+
}

automation/run-e2e/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"url": "https://github.com/mendix/web-widgets.git"
1717
},
1818
"scripts": {
19-
"lint": "eslint --ext .mjs ."
19+
"lint": "eslint --ext .mjs .",
20+
"format": "prettier --write ."
2021
},
2122
"dependencies": {
2223
"ansi-colors": "^4.1.3",
@@ -30,6 +31,7 @@
3031
"find-free-port": "^2.0.0",
3132
"ip": "^1.1.8",
3233
"node-fetch": "^2.6.1",
34+
"prettier": "^2.5.1",
3335
"shelljs": "^0.8.5",
3436
"yargs-parser": "^21.1.1"
3537
}

automation/run-e2e/support/commands.mjs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import compareSnapshotCommand from "cypress-image-diff-js";
2-
import installLogsCollector from "cypress-terminal-report/src/installLogsCollector"
2+
import installLogsCollector from "cypress-terminal-report/src/installLogsCollector";
33

44
console.log("support/commands loaded");
55
installLogsCollector();
@@ -21,37 +21,37 @@ Cypress.Commands.add("dragAndDrop", (subject, target, dragIndex, dropIndex) => {
2121
const BUTTON_INDEX = 0;
2222
const SLOPPY_CLICK_THRESHOLD = 10;
2323
cy.get(target)
24-
.eq(dropIndex)
25-
.then($target => {
26-
const coordsDrop = $target[0].getBoundingClientRect();
27-
cy.get(subject)
28-
.eq(dragIndex)
29-
.then(subject => {
30-
const coordsDrag = subject[0].getBoundingClientRect();
31-
cy.wrap(subject)
32-
.trigger("mousedown", {
33-
button: BUTTON_INDEX,
34-
clientX: coordsDrag.x,
35-
clientY: coordsDrag.y,
36-
force: true
37-
})
38-
.trigger("mousemove", {
39-
button: BUTTON_INDEX,
40-
clientX: coordsDrag.x + SLOPPY_CLICK_THRESHOLD,
41-
clientY: coordsDrag.y,
42-
force: true
43-
})
44-
.wait(1000);
45-
cy.get("body")
46-
.trigger("mousemove", {
47-
button: BUTTON_INDEX,
48-
clientX: coordsDrop.x,
49-
clientY: coordsDrop.y,
50-
force: true
51-
})
52-
.trigger("mouseup");
24+
.eq(dropIndex)
25+
.then($target => {
26+
const coordsDrop = $target[0].getBoundingClientRect();
27+
cy.get(subject)
28+
.eq(dragIndex)
29+
.then(subject => {
30+
const coordsDrag = subject[0].getBoundingClientRect();
31+
cy.wrap(subject)
32+
.trigger("mousedown", {
33+
button: BUTTON_INDEX,
34+
clientX: coordsDrag.x,
35+
clientY: coordsDrag.y,
36+
force: true
37+
})
38+
.trigger("mousemove", {
39+
button: BUTTON_INDEX,
40+
clientX: coordsDrag.x + SLOPPY_CLICK_THRESHOLD,
41+
clientY: coordsDrag.y,
42+
force: true
43+
})
44+
.wait(1000);
45+
cy.get("body")
46+
.trigger("mousemove", {
47+
button: BUTTON_INDEX,
48+
clientX: coordsDrop.x,
49+
clientY: coordsDrop.y,
50+
force: true
51+
})
52+
.trigger("mouseup");
53+
});
5354
});
54-
});
5555
});
5656
/*eslint-disable cypress/no-unnecessary-waiting*/
5757

pnpm-lock.yaml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)