@rpcbase/test 0.142.0 → 0.143.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +19 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/test",
3
- "version": "0.142.0",
3
+ "version": "0.143.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rb-test": "./src/cli.js"
package/src/cli.js CHANGED
@@ -13,6 +13,8 @@ if (process.env.IS_AIDER !== undefined && process.env.IS_AIDER !== "yes") {
13
13
 
14
14
  function runTests() {
15
15
  return new Promise((resolve, reject) => {
16
+ const userArgs = process.argv.slice(2)
17
+
16
18
  // Determine config file path
17
19
  const configPath = fs.existsSync(
18
20
  path.join(process.cwd(), "playwright.config.ts"),
@@ -20,12 +22,28 @@ function runTests() {
20
22
  ? path.join(process.cwd(), "playwright.config.ts")
21
23
  : path.join(__dirname, "playwright.config.ts")
22
24
 
25
+ const hasCustomConfig = userArgs.some((arg) => {
26
+ if (arg === "--config" || arg === "-c") {
27
+ return true
28
+ }
29
+
30
+ return arg.startsWith("--config=")
31
+ })
32
+
33
+ const playwrightArgs = ["test"]
34
+
35
+ if (!hasCustomConfig) {
36
+ playwrightArgs.push("--config", configPath)
37
+ }
38
+
39
+ playwrightArgs.push(...userArgs)
40
+
23
41
  const stdoutBuffer = []
24
42
  const stderrBuffer = []
25
43
 
26
44
  const playwright = spawn(
27
45
  "./node_modules/.bin/playwright",
28
- ["test", "--config", configPath],
46
+ playwrightArgs,
29
47
  {
30
48
  shell: false,
31
49
  },