File: cypress/integration/crashes.js

Recommend this page to a friend!
  Classes of Arturs Sosins   Countly Web SDK   cypress/integration/crashes.js   Download  
File: cypress/integration/crashes.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Countly Web SDK
Track site accesses and errors the Countly API
Author: By
Last change: New bundle (#456)

* new bundle

* read

* is

* reordered countly

* count.ly to countly

* re order features

* seperated elses

* function gap

* linter

* reverse linter

* gap

* more

* increased test robustness

* reminified

* removed mapping

* Update CHANGELOG.md

---------

Co-authored-by: Artūrs Kadiķis <kadikis.arturs@gmail.com>
fix and try countly removal (#455)
Date: 4 months ago
Size: 924 bytes
 

Contents

Class file image Download
/* eslint-disable require-jsdoc */ var Countly = require("../../lib/countly"); var hp = require("../support/helper"); function initMain() { Countly.init({ app_key: "YOUR_APP_KEY", url: "https://your.domain.countly", test_mode: true }); } function cause_error() { // eslint-disable-next-line no-undef undefined_function(); } describe("Crashes tests ", () => { it("Checks if a caught crash is reported correctly", () => { hp.haltAndClearStorage(() => { initMain(); Countly.track_errors(); try { cause_error(); } catch (err) { Countly.log_error(err); } cy.wait(3000).then(() => { cy.fetch_local_request_queue().then((rq) => { cy.check_crash(rq[0], hp.appKey); }); }); }); }); });