Skip to content

TypeError: Invalid URL #47

@ahtrotta

Description

@ahtrotta

To reproduce: In appmap-js run the following command in packages/scanner:

npx appmap-node@latest yarn test upload.spec.ts -t 'runs with default arguments'

I get the following output:

(Λ) Running with appmap-node version 2.5.1
(Λ) Detected Jest. Tests will be automatically recorded.
 FAIL  test/cli/upload.spec.ts (7.994 s)
  upload
    ✕ runs with default arguments (5016 ms)
    ○ skipped accepts branch and environment
    ○ skipped resolves commit and branch information from the environment
    ○ skipped the max size for uploads is less than 48MB by default
    ○ skipped prunes large AppMaps before uploading

  ● upload › runs with default arguments

    TypeError: Invalid URL

      at OverriddenClientRequest.<anonymous> (../../../../../.npm/_npx/a04c6870cebb0c63/node_modules/appmap-node/src/hooks/http.ts:65:17)
      at InterceptedRequestRouter.startPlayback (../../node_modules/nock/lib/intercepted_request_router.js:310:11)
      at InterceptedRequestRouter.maybeStartPlayback (../../node_modules/nock/lib/intercepted_request_router.js:262:12)
      at InterceptedRequestRouter.connectSocket (../../node_modules/nock/lib/intercepted_request_router.js:140:12)
      at ../../node_modules/nock/lib/intercepted_request_router.js:78:33

  ● upload › runs with default arguments

    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      109 |     const localhost = nock('http://localhost:3000');
      110 |     localhost.post(`/api/appmaps`).reply(201, AppMapData1, ['Content-Type', 'application/json']);
    > 111 |     localhost.post(`/api/appmaps`).reply(201, AppMapData2, ['Content-Type', 'application/json']);
          |   ^
      112 |     localhost.post(`/api/mapsets`).reply(201, MapsetData, ['Content-Type', 'application/json']);
      113 |     localhost.post(`/api/scanner_jobs`).reply(201, ScannerJobData, {
      114 |       location: `http://localhost:3000/scanner_jobs/${ScannerJobData.id}`,

      at test/cli/upload.spec.ts:111:3
      at Object.<anonymous> (test/cli/upload.spec.ts:110:1)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 4 skipped, 5 total
Snapshots:   0 total
Time:        8.069 s, estimated 24 s
Ran all test suites matching /upload.spec.ts/i with tests matching "runs with default arguments".
(Λ) Wrote /home/ahtrotta/projects/appmap/appmap-js/packages/scanner/tmp/appmap/jest/upload/runs with default arguments.appmap.json

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions