@ac-kit/vitest-config 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -1
- package/browser-commands.js +12 -9
- package/lib.js +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ac-kit/vitest-config
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1242374: `defineProject` now defaults `testTimeout` to 30 s and `hookTimeout` to 60 s,
|
|
8
|
+
instead of Vitest's 5 s and 10 s, so sound tests do not time out on a loaded CI
|
|
9
|
+
runner. A project's own `test` options still override both.
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @ac-kit/vitest-config
|
|
2
2
|
|
|
3
3
|
A shareable Vitest configuration for `@ac-kit` packages: Node environment,
|
|
4
|
-
type-checking enabled
|
|
4
|
+
type-checking enabled, and timeouts sized for a loaded CI runner (30 s a test,
|
|
5
|
+
60 s a hook) rather than Vitest's 5 s and 10 s.
|
|
5
6
|
|
|
6
7
|
## Usage
|
|
7
8
|
|
package/browser-commands.js
CHANGED
|
@@ -7,18 +7,21 @@ async function origin(context) {
|
|
|
7
7
|
return { x: box?.x ?? 0, y: box?.y ?? 0 };
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/** A CDP session of the page with touch emulation on. */
|
|
11
|
+
async function openSession(context) {
|
|
12
|
+
const created = await context.context.newCDPSession(context.page);
|
|
13
|
+
await created.send("Emulation.setTouchEmulationEnabled", {
|
|
14
|
+
enabled: true,
|
|
15
|
+
maxTouchPoints: 5,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return created;
|
|
19
|
+
}
|
|
20
|
+
|
|
10
21
|
function session(context) {
|
|
11
22
|
let existing = sessions.get(context.page);
|
|
12
23
|
if (existing === undefined) {
|
|
13
|
-
existing = (
|
|
14
|
-
const created = await context.context.newCDPSession(context.page);
|
|
15
|
-
await created.send("Emulation.setTouchEmulationEnabled", {
|
|
16
|
-
enabled: true,
|
|
17
|
-
maxTouchPoints: 5,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return created;
|
|
21
|
-
})();
|
|
24
|
+
existing = openSession(context);
|
|
22
25
|
sessions.set(context.page, existing);
|
|
23
26
|
}
|
|
24
27
|
|
package/lib.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/vitest-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shareable Vitest configuration for @ac-kit packages: Node environment, type-checking enabled.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"test": "yarn run -T vitest run"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@vitest/browser-playwright": "5.1.
|
|
56
|
+
"@vitest/browser-playwright": "5.1.2",
|
|
57
57
|
"playwright": "1.65.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|