@mochify/mochify
Version:
Run mocha tests in headless browsers
19 lines (18 loc) • 727 B
TypeScript
export type MochifyDriver = import("./driver").MochifyDriver;
/**
* This hack works around the following issues:
*
* https://github.com/mantoni/mochify.js/issues/110
* https://bugs.chromium.org/p/chromedriver/issues/detail?id=402
* https://github.com/sinonjs/sinon/issues/912
*
* Apparently the Chrome webdriver has a buffer limit somewhere around 1 MB.
* Injecting scripts that are below a certain size works reliably, so we're
* slicing the actual script into chunks, merge the parts in the browser and
* then inject a script tag there.
*
* @param {MochifyDriver} driver
* @param {string} script
* @returns {Promise<void>}
*/
export function injectScript(driver: MochifyDriver, script: string): Promise<void>;