score:3

Accepted answer

this is a pattern that has worked for me for certain jquery methods in mocha, i'm not sure it'll work for ajax but give it a shot and let me know.

import jsdom from 'jsdom'
import _$ from 'jquery'

global.document = jsdom.jsdom('<!doctype html><html><body></body></html>')
global.window = global.document.defaultview
const $ = _$(global.window)

Related Query

More Query from same tag