All files / src/Simulate Environment.ts

50% Statements 5/10
100% Branches 0/0
0% Functions 0/4
50% Lines 5/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22      2x   2x       2x       2x         2x      
import { IMockEnvironment } from "../MockEnvironment";
import { ISimulateQueryData } from "../Simulate";
import * as Fake from "../Fake";
import { JQuery } from "./JQueryModule";
 
export function isPhantomJs(): boolean {
  return navigator.userAgent.indexOf("PhantomJS") !== -1;
}
 
export function isChromeHeadless(): boolean {
  return navigator.userAgent.indexOf("HeadlessChrome") !== -1;
}
 
export function addJQuery(): any {
  window["Coveo"]["$"] = JQuery;
  return JQuery;
}
 
export function removeJQuery(): void {
  window["Coveo"]["$"] = null;
}