File: test/tests_user_details.js

Recommend this page to a friend!
  Classes of Arturs Sosins   Countly SDK for Node.js   test/tests_user_details.js   Download  
File: test/tests_user_details.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Countly SDK for Node.js
Report events to be tracked with by Count.ly API
Author: By
Last change: Refactoring Some More
Refactoring Test Objects
test refactor
Date: 1 month ago
Size: 929 bytes
 

Contents

Class file image Download
/* eslint-disable no-console */ const assert = require("assert"); var Countly = require("../lib/countly"); var hp = require("./helpers/helper_functions"); var testUtils = require("./helpers/test_utils"); describe("User details tests", () => { beforeEach(async() => { await hp.clearStorage(); }); it("Record and validate all user details", (done) => { Countly.init({ app_key: "YOUR_APP_KEY", url: "https://try.count.ly", }); var userDetailObj = testUtils.getUserDetailsObj(); Countly.user_details(userDetailObj); // read event queue setTimeout(() => { var req = hp.readRequestQueue()[0]; const actualUserDetails = req.user_details; const isValid = hp.validateUserDetails(actualUserDetails, userDetailObj); assert.equal(true, isValid); done(); }, hp.sWait); }); });