Repository: elastic/synthetics
Pull request #463 (2022-02-23 19:56:40)

update deprecated apis and dependencies
+ uses `browser.connect(wsendpoint, {})` instead of the old deprecated API
+ Updated dependencies to the latest version to prepare the update for PW sooner. 

apmmachine: 
## :broken_heart: Tests Failed


<!-- BUILD BADGES-->
> _the below badges are clickable and redirect to their specific view in the CI or DOCS_
[![Pipeline View](https://img.shields.io/badge/pipeline-pipeline%20-green)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//pipeline) [![Test View](https://img.shields.io/badge/test-test-green)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//tests) [![Changes](https://img.shields.io/badge/changes-changes-green)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//changes) [![Artifacts](https://img.shields.io/badge/artifacts-artifacts-yellow)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//artifacts) [![preview](https://img.shields.io/badge/docs-preview-yellowgreen)](http://synthetics_463.docs-preview.app.elstc.co/diff)  [![preview](https://img.shields.io/badge/elastic-observability-blue)](https://ci-stats.elastic.co/app/apm/services/apm-ci/transactions/view?rangeFrom=2022-02-23T19:46:58.802Z&rangeTo=2022-02-23T20:06:58.802Z&transactionName=apm-agent-rum/elastic-synthetics/PR-{number}&transactionType=job&latencyAggregationType=avg&traceId=c8a49072648abd20916550e490cd274c&transactionId=ab4157cc698d3069)

<!-- BUILD SUMMARY-->
<details><summary>Expand to view the summary</summary>
<p>

#### Build stats




* Start Time: 2022-02-23T19:56:58.802+0000


* Duration: 8 min 45 sec




#### Test stats :test_tube:

| Test         | Results                         |
| ------------ | :-----------------------------: |
| Failed       | 1  |
| Passed       | 142  |
| Skipped      | 3 |
| Total        | 146   |


</p>
</details>

<!-- TEST RESULTS IF ANY-->

  ### Test errors [![1](https://img.shields.io/badge/1%20-red)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//tests)
<details><summary>Expand to view the tests failures</summary><p>
    
    
##### `Test / json reporter formats network fields in ECS format – json reporter formats network fields in ECS format`


<ul>
<details><summary>Expand to view the error details</summary><p>

```
 null 
 ```
</p></details>
<details><summary>Expand to view the stacktrace</summary><p>

```
 Error: expect(received).toMatchSnapshot()

Snapshot name: `json reporter formats network fields in ECS format 1`

- Snapshot  - 1
+ Received  + 1

@@ -31,11 +31,11 @@
          "from_prefetch_cache": false,
          "from_service_worker": false,
          "headers": Object {},
          "mime_type": "text/html",
          "protocol": "h2",
-         "remote_i_p_address": "[2606:4700:3035::ac43:83e0]",
+         "remote_ip_address": "[2606:4700:3035::ac43:83e0]",
          "remote_port": 443,
          "response_time": 1612482095476.922,
          "security_details": Object {
            "certificate_id": 0,
            "certificate_transparency_compliance": "unknown",
    at Object.<anonymous> (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/__tests__/reporters/json.test.ts:201:36)
    at Promise.then.completed (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/run.js:218:40)
    at _runTest (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/run.js:66:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/run.js:60:9)
    at run (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/nt-rum_elastic-synthetics_PR-463/src/github.com/elastic/synthetics/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) 
 ```
</p></details>
</ul>
    
</p></details>


<!-- STEPS ERRORS IF ANY -->












### Steps errors [![1](https://img.shields.io/badge/1%20-red)](https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-rum%2Felastic-synthetics%2FPR-463/detail/PR-463/1//pipeline)
  <details><summary>Expand to view the steps failures</summary>
  <p>


  
  
  
  
##### `Runs the tests`
<ul>
<li>Took 1 min 9 sec . View more details <a href="https://apm-ci.elastic.co//blue/rest/organizations/jenkins/pipelines/apm-agent-rum/pipelines/elastic-synthetics/pipelines/PR-463/runs/1/steps/343/log/?start=0">here</a></li>
<li>Description: <code>./node_modules/.bin/jest --ci --reporters=default --reporters=jest-junit</code></l1>
</ul>
  
  </p>
  </details>



## :robot: GitHub comments

To re-run your PR in the CI, just comment with:



- `/test` : Re-trigger the build.




<!--COMMENT_GENERATED_WITH_ID_comment.id-->

Patch:
diff --git a/package-lock.json b/package-lock.json
index 93fc644..9ac972a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -446,9 +446,9 @@
       "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg=="
     },
     "@cspotcode/source-map-support": {
-      "version": "0.6.1",
-      "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz",
-      "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==",
+      "version": "0.7.0",
+      "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz",
+      "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==",
       "requires": {
         "@cspotcode/source-map-consumer": "0.8.0"
       }
@@ -1798,9 +1798,9 @@
       "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI="
     },
     "buffer-from": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
-      "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
     },
     "callsites": {
       "version": "3.1.0",
@@ -1972,9 +1972,9 @@
       }
     },
     "commander": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
-      "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="
+      "version": "9.0.0",
+      "resolved": "https://registry.npmjs.org/commander/-/commander-9.0.0.tgz",
+      "integrity": "sha512-JJfP2saEKbQqvW+FI93OYUB4ByV5cizMpFMiiJI8xDbBvQvSkIk0VvQdn1CZ8mqAO8Loq2h0gYTYtDFUZUeERw=="
     },
     "compare-versions": {
       "version": "3.6.0",
@@ -5080,9 +5080,9 @@
       }
     },
     "map-obj": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz",
-      "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ=="
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz",
+      "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ=="
     },
     "merge-stream": {
       "version": "2.0.0",
@@ -5876,9 +5876,9 @@
       "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
     },
     "source-map-support": {
-      "version": "0.5.19",
-      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
-      "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+      "version": "0.5.21",
+      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
       "requires": {
         "buffer-from": "^1.0.0",
         "source-map": "^0.6.0"
@@ -6151,11 +6151,11 @@
       }
     },
     "ts-node": {
-      "version": "10.2.1",
-      "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz",
-      "integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==",
+      "version": "10.5.0",
+      "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.5.0.tgz",
+      "integrity": "sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==",
       "requires": {
-        "@cspotcode/source-map-support": "0.6.1",
+        "@cspotcode/source-map-support": "0.7.0",
         "@tsconfig/node10": "^1.0.7",
         "@tsconfig/node12": "^1.0.7",
         "@tsconfig/node14": "^1.0.0",
@@ -6166,13 +6166,14 @@
         "create-require": "^1.1.0",
         "diff": "^4.0.1",
         "make-error": "^1.1.1",
+        "v8-compile-cache-lib": "^3.0.0",
         "yn": "3.1.1"
       },
       "dependencies": {
         "acorn-walk": {
-          "version": "8.1.1",
-          "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz",
-          "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w=="
+          "version": "8.2.0",
+          "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
+          "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA=="
         }
       }
     },
@@ -6224,9 +6225,9 @@
       }
     },
     "typescript": {
-      "version": "4.3.5",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
-      "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA=="
+      "version": "4.5.5",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz",
+      "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA=="
     },
     "universalify": {
       "version": "0.1.2",
@@ -6254,6 +6255,11 @@
       "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
       "dev": true
     },
+    "v8-compile-cache-lib": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz",
+      "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA=="
+    },
     "v8-to-istanbul": {
       "version": "8.1.0",
       "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz",
diff --git a/package.json b/package.json
index 45f2f60..fdac997 100644
--- a/package.json
+++ b/package.json
@@ -38,19 +38,19 @@
   "author": "",
   "license": "MIT",
   "dependencies": {
-    "commander": "^7.0.0",
+    "commander": "^9.0.0",
     "deepmerge": "^4.2.2",
     "expect": "^27.0.2",
     "http-proxy": "^1.18.1",
-    "kleur": "^4.1.3",
+    "kleur": "^4.1.4",
     "micromatch": "^4.0.4",
     "playwright-chromium": "=1.14.0",
     "sharp": "^0.30.1",
     "snakecase-keys": "^3.2.1",
     "sonic-boom": "^2.6.0",
-    "source-map-support": "^0.5.19",
-    "ts-node": "^10.2.1",
-    "typescript": "^4.3.5"
+    "source-map-support": "^0.5.21",
+    "ts-node": "^10.5.0",
+    "typescript": "^4.5.5"
   },
   "devDependencies": {
     "@types/jest": "^27.4.0",
diff --git a/src/core/gatherer.ts b/src/core/gatherer.ts
index fbdeda1..638efc5 100644
--- a/src/core/gatherer.ts
+++ b/src/core/gatherer.ts
@@ -43,7 +43,7 @@ export class Gatherer {
     if (Gatherer.browser == null) {
       if (wsEndpoint) {
         log(`Gatherer: connecting to WS endpoint: ${wsEndpoint}`);
-        Gatherer.browser = await chromium.connect({ wsEndpoint });
+        Gatherer.browser = await chromium.connect(wsEndpoint);
       } else {
         Gatherer.browser = await chromium.launch({
           ...playwrightOptions,


Test patch:
diff --git a/__tests__/core/gatherer.test.ts b/__tests__/core/gatherer.test.ts
index cbb638f..876a21e 100644
--- a/__tests__/core/gatherer.test.ts
+++ b/__tests__/core/gatherer.test.ts
@@ -60,7 +60,7 @@ describe('Gatherer', () => {
       const chromiumLaunch = jest
         .spyOn(chromium, 'launch')
         .mockImplementation(() => {
-          return chromium.connect({ wsEndpoint });
+          return chromium.connect(wsEndpoint);
         });
 
       await Gatherer.setupDriver({
@@ -82,7 +82,7 @@ describe('Gatherer', () => {
       const chromiumLaunch = jest
         .spyOn(chromium, 'launch')
         .mockImplementation(() => {
-          return chromium.connect({ wsEndpoint });
+          return chromium.connect(wsEndpoint);
         });
 
       await Gatherer.setupDriver({