@@ -2,7 +2,7 @@ import assert from 'assert';
2
2
import Analytics from '../src' ;
3
3
import createServer from './server' ;
4
4
5
- const version = require ( '../package.json' ) . version ;
5
+ const { version } = require ( '../package.json' ) ;
6
6
7
7
let analytics ;
8
8
const noop = function noop ( ) { } ;
@@ -96,7 +96,7 @@ describe('Analytics', () => {
96
96
analytics . enqueue ( 'type' , { timestamp : date } , noop ) ;
97
97
98
98
const msg = analytics . queue [ 0 ] . message ;
99
- const callback = analytics . queue [ 0 ] . callback ;
99
+ const { callback } = analytics . queue [ 0 ] ;
100
100
101
101
assert . equal ( callback , noop ) ;
102
102
assert . equal ( msg . type , 'type' ) ;
@@ -227,7 +227,9 @@ describe('Analytics', () => {
227
227
describe ( '#group' , ( ) => {
228
228
it ( 'should enqueue a message' , ( ) => {
229
229
const date = new Date ( ) ;
230
- analytics . group ( { groupId : 'group' , userId : 'user' , timestamp : date , messageId : id } ) ;
230
+ analytics . group ( {
231
+ groupId : 'group' , userId : 'user' , timestamp : date , messageId : id ,
232
+ } ) ;
231
233
assert . deepEqual ( analytics . queue [ 0 ] . message , {
232
234
type : 'group' ,
233
235
userId : 'user' ,
@@ -258,7 +260,9 @@ describe('Analytics', () => {
258
260
describe ( '#track' , ( ) => {
259
261
it ( 'should enqueue a message' , ( ) => {
260
262
const date = new Date ( ) ;
261
- analytics . track ( { userId : 'id' , event : 'event' , timestamp : date , messageId : id } ) ;
263
+ analytics . track ( {
264
+ userId : 'id' , event : 'event' , timestamp : date , messageId : id ,
265
+ } ) ;
262
266
assert . deepEqual ( analytics . queue [ 0 ] . message , {
263
267
type : 'track' ,
264
268
event : 'event' ,
@@ -271,7 +275,9 @@ describe('Analytics', () => {
271
275
272
276
it ( 'should handle a user ids given as a number' , ( ) => {
273
277
const date = new Date ( ) ;
274
- analytics . track ( { userId : 1 , event : 'jumped the shark' , timestamp : date , messageId : id } ) ;
278
+ analytics . track ( {
279
+ userId : 1 , event : 'jumped the shark' , timestamp : date , messageId : id ,
280
+ } ) ;
275
281
assert . deepEqual ( analytics . queue [ 0 ] . message , {
276
282
userId : 1 ,
277
283
event : 'jumped the shark' ,
@@ -350,7 +356,9 @@ describe('Analytics', () => {
350
356
describe ( '#alias' , ( ) => {
351
357
it ( 'should enqueue a message' , ( ) => {
352
358
const date = new Date ( ) ;
353
- analytics . alias ( { previousId : 'previous' , userId : 'id' , timestamp : date , messageId : id } ) ;
359
+ analytics . alias ( {
360
+ previousId : 'previous' , userId : 'id' , timestamp : date , messageId : id ,
361
+ } ) ;
354
362
assert . deepEqual ( analytics . queue [ 0 ] . message , {
355
363
type : 'alias' ,
356
364
previousId : 'previous' ,
0 commit comments