javascript How to mock global variable or method in JavaScript unit tests Sinon testing lib is handy to mock the global scope variables.Here's example of using sinon.sandboximport { assert } from "chai"; import * as sinon from "sinon"; import * as someLib form "some-lib"; import { methodThatUseSomeMethod } from