Uncovered in https://github.com/mozilla/addons-frontend/pull/11593#discussion_r899031000.
Some server-specific tests run w/ Jest's testEnvironment: 'jsdom', which is the project's Jest config default.
As a result, some globals are missing or extraneous & test environment is not suited.
This can be solved by either:
splitting jsdom & node test environments w/ their own test command
using testEnvironment: 'node' by default, and using the @jest-environment jsdom docblock when needed
keeping testEnvironment: 'jsdom' by default, and using the @jest-environment node docblock when needed
Uncovered in https://github.com/mozilla/addons-frontend/pull/11593#discussion_r899031000. Some server-specific tests run w/ Jest's
testEnvironment: 'jsdom'
, which is the project's Jest config default. As a result, some globals are missing or extraneous & test environment is not suited. This can be solved by either:jsdom
&node
test environments w/ their own test commandtestEnvironment: 'node'
by default, and using the@jest-environment jsdom
docblock when neededtestEnvironment: 'jsdom'
by default, and using the@jest-environment node
docblock when neededSee also:
┆Issue is synchronized with this Jira Task