@autifyhq/autify-cli-integration-test 0.46.0 → 0.48.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.
@@ -13,5 +13,6 @@ const args = node_process_1.argv.slice(2);
13
13
  const testPathPattern = args.length === 0 ? "" : `--testPathPattern '(${args.join("|")})'`;
14
14
  (0, node_child_process_1.execSync)(`npm run ${command} -- ${testPathPattern}`, {
15
15
  stdio: "inherit",
16
+ env: { ...process.env, NODE_OPTIONS: "--no-deprecation" },
16
17
  cwd: rootDir,
17
18
  });
@@ -19,7 +19,7 @@ const getPollyMode = () => {
19
19
  return AUTIFY_POLLY_RECORD ? "record" : "replay";
20
20
  };
21
21
  const getAutifyCli = () => {
22
- let autify = AUTIFY_CLI_PATH !== null && AUTIFY_CLI_PATH !== void 0 ? AUTIFY_CLI_PATH : "autify";
22
+ let autify = AUTIFY_CLI_PATH ?? "autify";
23
23
  if (process.platform === "win32") {
24
24
  autify += ".cmd";
25
25
  }
@@ -38,16 +38,15 @@ const ignoreBody = (request) => {
38
38
  return true;
39
39
  };
40
40
  const filterRecording = ({ request, response }) => {
41
- var _a;
42
41
  if (isCreateAccessPoint(request)) {
43
- response.content.text = (_a = response.content.text) === null || _a === void 0 ? void 0 : _a.replace(/"key":"[^"]+"/, `"key":"000000000000000000000000000000"`);
42
+ response.content.text = response.content.text?.replace(/"key":"[^"]+"/, `"key":"000000000000000000000000000000"`);
44
43
  }
45
44
  };
46
45
  const createPolly = async (args) => {
47
46
  const mode = getPollyMode();
48
47
  // eslint-disable-next-line unicorn/prefer-module
49
48
  const scriptDir = __dirname;
50
- const recordingsDir = node_path_1.default.join(scriptDir, "..", "..", "__recordings__", encodeURIComponent(args.join(" ")));
49
+ const recordingsDir = node_path_1.default.join(scriptDir, "..", "..", "__recordings__", encodeURIComponent(args.map((arg) => arg.replaceAll(/"+/g, "")).join(" ")));
51
50
  const polly = new core_1.Polly("polly-proxy", {
52
51
  mode,
53
52
  adapters: ["node-http"],
@@ -99,6 +98,7 @@ const autifyWithProxy = async (originalArgs) => {
99
98
  AUTIFY_WEB_BASE_PATH: `http://127.0.0.1:${webProxy.port}/api/v1/`,
100
99
  AUTIFY_MOBILE_BASE_PATH: `http://127.0.0.1:${mobileProxy.port}/api/v1/`,
101
100
  },
101
+ shell: process.platform === "win32",
102
102
  stdio: "inherit",
103
103
  });
104
104
  return new Promise((resolve, reject) => {
@@ -17,7 +17,7 @@ const normalize = (stdout) => stdout
17
17
  .replace(/Your session ID is "[^"]+"/, 'Your session ID is "fake"')
18
18
  .replace(/»/g, "›");
19
19
  const execAutifyCli = async (args) => {
20
- const command = `autify-with-proxy ${args}`;
20
+ const command = `autify-with-proxy ${process.platform === "win32" ? args.replaceAll(/"([^"]+)"/g, '""""$1""') : args}`;
21
21
  const { stdout, stderr } = await (0, node_util_1.promisify)(node_child_process_1.exec)(command, { env: node_process_1.env });
22
22
  return {
23
23
  stdout: normalize((0, strip_ansi_1.default)(stdout)),
@@ -6,6 +6,6 @@ const execAutifyCli_1 = require("../helpers/execAutifyCli");
6
6
  const testAutifyCliSnapshot = (command) => {
7
7
  test(`autify ${command}`, async () => {
8
8
  expect(await (0, execAutifyCli_1.execAutifyCli)(command)).toMatchSnapshot();
9
- }, 300000);
9
+ }, 300_000);
10
10
  };
11
11
  exports.testAutifyCliSnapshot = testAutifyCliSnapshot;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autifyhq/autify-cli-integration-test",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "description": "Autify Command Line Interface (CLI) Integration Test",
5
5
  "author": "Autify",
6
6
  "bin": {
@@ -38,11 +38,11 @@
38
38
  "devDependencies": {
39
39
  "@types/express": "^4.17.21",
40
40
  "@types/jest": "^29.5.12",
41
- "@types/node": "^20.14.9",
41
+ "@types/node": "^20.14.13",
42
42
  "@types/which": "^3.0.4",
43
43
  "shx": "^0.3.4",
44
44
  "ts-node": "^10.9.2",
45
- "typescript": "^5.5.2"
45
+ "typescript": "^5.5.4"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "shx rm -rf dist && tsc -b",
@@ -51,7 +51,7 @@
51
51
  "test:record": "AUTIFY_POLLY_RECORD=1 jest --testMatch **/dist/test/**/*.test.js --updateSnapshot"
52
52
  },
53
53
  "engines": {
54
- "node": ">=20.14.0"
54
+ "node": ">=22.5.1"
55
55
  },
56
56
  "bugs": {
57
57
  "url": "https://github.com/autifyhq/autify-cli/issues"