wbxcallprov/test
jmcqueen 203850fd69
Some checks are pending
CI / verify (push) Waiting to run
Fix requestJson dropping Content-Type on POSTs (HTTP 415)
requestJson merged Content-Type: application/json into a headers object,
then spread `...extra` after `headers` in the fetch options — which let
extra.headers (always passed by webexJson for Authorization) overwrite
the merged object, stripping Content-Type entirely. Undici then
defaulted the string body's Content-Type to text/plain;charset=UTF-8,
and strict Webex endpoints like POST /locations rejected the request
with HTTP 415. Latent since the node-fetch -> native fetch migration.

Reorder to `{ method, ...extra, headers }` so the explicit merged
headers win, and add a test/http.test.js suite (7 tests) that pins the
merge behaviour down so this can't regress silently again.

Also: update the npm test script to `test/**/*.test.js` glob. Node
22.23 no longer accepts a bare `test/` directory as a positional arg
to `--test` (fails with ERR_UNSUPPORTED_DIR_IMPORT).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 12:07:15 -04:00
..
dect.test.js Add /provisionPhone for wired desk phones (7841/7821) 2026-07-07 12:39:06 -04:00
google.test.js Add node:test suite and Gitea Actions CI 2026-07-06 16:07:02 -04:00
greetingSelector.test.js Add node:test suite and Gitea Actions CI 2026-07-06 16:07:02 -04:00
helpers.test.js Add /provisionPhone for wired desk phones (7841/7821) 2026-07-07 12:39:06 -04:00
http.test.js Fix requestJson dropping Content-Type on POSTs (HTTP 415) 2026-07-09 12:07:15 -04:00
mac.test.js Add /provisionPhone for wired desk phones (7841/7821) 2026-07-07 12:39:06 -04:00
phones.test.js Add /provisionPhone for wired desk phones (7841/7821) 2026-07-07 12:39:06 -04:00
setup.js Add node:test suite and Gitea Actions CI 2026-07-06 16:07:02 -04:00
stepRunner.test.js Add node:test suite and Gitea Actions CI 2026-07-06 16:07:02 -04:00
webexClient.test.js Add node:test suite and Gitea Actions CI 2026-07-06 16:07:02 -04:00