<commit_before>/*eslint-env browser, mocha */
/*global
    Bugsnag: true
    assert: true
    stub: true
*/

after(function () {
  var passes, fails;

  var ems = document.getElementsByTagName("em");
  for (var i = 0; i < ems.length; i++) {
    if (ems[i].parentNode.className === "passes") {
      passes = parseInt(ems[i].innerHTML);
    } else if (ems[i].parentNode.className === "failures") {
      fails = parseInt(ems[i].innerHTML, 10);
    }
  }
  document.title =  passes + "/" + (passes + fails);
});
describe("Bugsnag", function () {
  this.timeout(4000);
  beforeEach(buildUp);
  afterEach(tearDown);

  describe("notifyException", function () {
    it("should not notify if apiKey is false", function () {
      Bugsnag.apiKey = false;
      Bugsnag.notifyException(new Error("Example error"));

      assert(!Bugsnag.testRequest.called, "Bugsnag.testRequest should not have been called");
    });

    it("should not notify if apiKey is not set", function () {
      Bugsnag.apiKey = null;
      Bugsnag.notifyException(new Error("Example error"));

      assert(!Bugsnag.testRequest.called, "Bugsnag.testRequest should not have been called");
    });

    it("should not notify if apiKey is invalid", function () {
      Bugsnag.apiKey = "bad-api-key";
      Bugsnag.notifyException(new Error("Example error"));<commit_msg>remove timeout inside tests<commit_after>/*eslint-env browser, mocha */
/*global
    Bugsnag: true
    assert: true
    stub: true
*/

after(function () {
  var passes, fails;

  var ems = document.getElementsByTagName("em");
  for (var i = 0; i < ems.length; i++) {
    if (ems[i].parentNode.className === "passes") {
      passes = parseInt(ems[i].innerHTML);
    } else if (ems[i].parentNode.className === "failures") {
      fails = parseInt(ems[i].innerHTML, 10);
    }
  }
  document.title =  passes + "/" + (passes + fails);
});
describe("Bugsnag", function () {
  beforeEach(buildUp);
  afterEach(tearDown);

  describe("notifyException", function () {
    it("should not notify if apiKey is false", function () {
      Bugsnag.apiKey = false;
      Bugsnag.notifyException(new Error("Example error"));

      assert(!Bugsnag.testRequest.called, "Bugsnag.testRequest should not have been called");
    });

    it("should not notify if apiKey is not set", function () {
      Bugsnag.apiKey = null;
      Bugsnag.notifyException(new Error("Example error"));

      assert(!Bugsnag.testRequest.called, "Bugsnag.testRequest should not have been called");
    });

    it("should not notify if apiKey is invalid", function () {
      Bugsnag.apiKey = "bad-api-key";
      Bugsnag.notifyException(new Error("Example error"));
{'fraction_non_alphanumeric': 0.15078769692423105, 'fraction_numerical': 0.0037509377344336083, 'mean_word_length': 3.4748322147651005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6303978', 'n_tokens_mistral': 853, 'n_tokens_neox': 835, 'n_words': 203}