@rpcbase/test 0.121.0 → 0.122.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/test",
3
- "version": "0.121.0",
3
+ "version": "0.122.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rb-test": "./src/cli.js"
@@ -1,5 +1,6 @@
1
1
  import mongoose from "mongoose"
2
2
 
3
+
3
4
  export async function clearDatabase(dbName) {
4
5
  const { MONGO_PORT, APP_NAME } = process.env
5
6
 
package/src/cli.js CHANGED
@@ -4,10 +4,11 @@ import { spawn } from "child_process"
4
4
  import fs from "fs"
5
5
  import path from "path"
6
6
 
7
- const isAider = process.env.IS_AIDER === "yes";
7
+
8
+ const isAider = process.env.IS_AIDER === "yes"
8
9
 
9
10
  if (process.env.IS_AIDER !== undefined && process.env.IS_AIDER !== "yes") {
10
- console.warn("Warning: IS_AIDER is set to a value other than 'yes'.");
11
+ console.warn("Warning: IS_AIDER is set to a value other than 'yes'.")
11
12
  }
12
13
 
13
14
  function runTests() {
@@ -17,10 +18,10 @@ function runTests() {
17
18
  path.join(process.cwd(), "playwright.config.ts"),
18
19
  )
19
20
  ? path.join(process.cwd(), "playwright.config.ts")
20
- : path.join(__dirname, "playwright.config.ts");
21
+ : path.join(__dirname, "playwright.config.ts")
21
22
 
22
- const stdoutBuffer = [];
23
- const stderrBuffer = [];
23
+ const stdoutBuffer = []
24
+ const stderrBuffer = []
24
25
 
25
26
  const playwright = spawn(
26
27
  "./node_modules/.bin/playwright",
@@ -28,37 +29,41 @@ function runTests() {
28
29
  {
29
30
  shell: false,
30
31
  },
31
- );
32
+ )
32
33
 
33
34
  playwright.stdout.on("data", (data) => {
34
- !isAider && process.stdout.write(data);
35
- stdoutBuffer.push(data.toString());
36
- });
35
+ if (!isAider) {
36
+ process.stdout.write(data)
37
+ }
38
+ stdoutBuffer.push(data.toString())
39
+ })
37
40
 
38
41
  playwright.stderr.on("data", (data) => {
39
- !isAider && process.stderr.write(data);
40
- stderrBuffer.push(data.toString());
41
- });
42
+ if (!isAider) {
43
+ process.stderr.write(data)
44
+ }
45
+ stderrBuffer.push(data.toString())
46
+ })
42
47
 
43
48
  playwright.on("close", (code) => {
44
49
  if (code === 0) {
45
- console.log("All tests passed!");
46
- resolve();
50
+ console.log("All tests passed!")
51
+ resolve()
47
52
  } else {
48
- console.error("Tests failed:");
53
+ console.error("Tests failed:")
49
54
  console.error(stdoutBuffer.join(""))
50
55
 
51
- reject(new Error(`Tests failed with exit code: ${code}`));
56
+ reject(new Error(`Tests failed with exit code: ${code}`))
52
57
  }
53
- });
58
+ })
54
59
 
55
60
  playwright.on("error", (error) => {
56
- console.error("Error spawning Playwright:", error);
57
- reject(error);
58
- });
59
- });
61
+ console.error("Error spawning Playwright:", error)
62
+ reject(error)
63
+ })
64
+ })
60
65
  }
61
66
 
62
67
  runTests()
63
68
  .then(() => process.exit(0))
64
- .catch(() => process.exit(1));
69
+ .catch(() => process.exit(1))
@@ -1,11 +1,12 @@
1
1
  import fs from "fs"
2
2
  import { cpus } from "os"
3
+
3
4
  import _ from "lodash"
4
5
  import { defineConfig, devices } from "@playwright/test"
5
6
 
6
7
 
7
8
  function mergeConfig(base, override) {
8
- return _.merge({}, base, override);
9
+ return _.merge({}, base, override)
9
10
  }
10
11
 
11
12
  const hasPassedAllPreviousTests = (data) => {