[Bug]: URLSearchParams#get(k, v)
is not implemented and uses URLSearchParams#get(k)
instead
#14954
Labels
URLSearchParams#get(k, v)
is not implemented and uses URLSearchParams#get(k)
instead
#14954
Version
29.7.0
Steps to reproduce
Prepare
git clone https://github.com/kvndrsslr/jest-bug-urlsearchparams-has-k-v.git cd jest-bug-urlsearchparams-has-k-v npm ci
Test
npm run test
This fails only on
./jsdom-test-env.test.js
.Now try to comment out line 3 in
./jest.config.js
and run again:npm run test
This time all the tests pass.
Expected behavior
URLSearchParams.has(k,v)
works as expected.Actual behavior
Instead of
URLSearchParams.has(k,v)
, onlyURLSearchParams.has(k)
is implemented and hence returns false positives in tests that contain.has(k,v)
Additional context
URLSearchParams#has(k,v)
seems to be not correctly implemented in jest only when usingtestEnvironment: 'jsdom'
.I have no idea where this goes wrong, as it works in
node
by default and it works when testingjsdom
andwhatwg-url
in isolation too.Environment
The text was updated successfully, but these errors were encountered: