browser-ava 1.3.13 → 1.3.15

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021-2022 by arlac77
1
+ Copyright (c) 2021-2023 by arlac77
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-ava",
3
- "version": "1.3.13",
3
+ "version": "1.3.15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@koa/cors": "^4.0.0",
31
- "chalk": "^5.1.2",
31
+ "chalk": "^5.2.0",
32
32
  "commander": "^9.4.1",
33
33
  "es-module-lexer": "^1.0.5",
34
34
  "globby": "^13.1.3",
35
- "koa": "^2.14.0",
35
+ "koa": "^2.14.1",
36
36
  "koa-static": "^5.0.0",
37
- "playwright": "^1.29.0",
37
+ "playwright": "^1.29.1",
38
38
  "ws": "^8.11.0"
39
39
  },
40
40
  "devDependencies": {
@@ -121,7 +121,7 @@ program
121
121
  if (data.todo) {
122
122
  } else {
123
123
  if (data.passed === true) {
124
- console.log( " ", chalk.green("✔"), data.title);
124
+ console.log(" ", chalk.green("✔"), data.title);
125
125
  } else {
126
126
  console.log(" ", chalk.red("✘ [fail]: "), data.title);
127
127
  }
@@ -190,13 +190,17 @@ async function loadAndRewriteImports(file) {
190
190
  }
191
191
 
192
192
  if (m) {
193
- body = body.substring(0, i.s + d) + m + body.substring(i.e + d);
193
+ if (i.d > -1) {
194
+ body = body.substring(0, i.s + 1 + d) + m + body.substring(i.e - 1 + d);
195
+ } else {
196
+ body = body.substring(0, i.s + d) + m + body.substring(i.e + d);
197
+ }
198
+
194
199
  d += m.length - i.n.length;
195
200
  } else {
196
201
  console.warn(`Unable to resolve "${i.n}" may lead to import errors`);
197
202
  }
198
203
  }
199
-
200
204
  return body;
201
205
  }
202
206