Paula Muldoon
12/15/2022, 11:53 AMFormData is not defined when I run the test within the node env and ReferenceError: setImmediate is not defined when I run within jsdom. This later error seems to be an issue with Jest 27 and up, but I don't want to downgrade the Jest version.Yousaf Nabi (pactflow.io)
npx -y pactman
2. Pact
3. jest
4. <enter>
5. chefkissYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Paula Muldoon
12/15/2022, 12:10 PM/**
* @jest-environment node
*/
which successfully switches the env to node I assume, as the reference error is gone). The problem is my test uses jsdom-specific code:
it('returns the correct response', (done) => {
const formData = new FormData();
formData.append(
'file',
'this is the file string',
'this is the file name',
);Paula Muldoon
12/15/2022, 12:11 PMMatt (pactflow.io / pact-js / pact-go)
FormData I’m assuming it’s going to be a multipart form post, which should be testablePaula Muldoon
12/16/2022, 9:34 AM