@@ -2,7 +2,7 @@ import assert from 'assert';
22import Analytics from '../src' ;
33import createServer from './server' ;
44
5- const version = require ( '../package.json' ) . version ;
5+ const { version } = require ( '../package.json' ) ;
66
77let analytics ;
88const noop = function noop ( ) { } ;
@@ -96,7 +96,7 @@ describe('Analytics', () => {
9696 analytics . enqueue ( 'type' , { timestamp : date } , noop ) ;
9797
9898 const msg = analytics . queue [ 0 ] . message ;
99- const callback = analytics . queue [ 0 ] . callback ;
99+ const { callback } = analytics . queue [ 0 ] ;
100100
101101 assert . equal ( callback , noop ) ;
102102 assert . equal ( msg . type , 'type' ) ;
@@ -227,7 +227,9 @@ describe('Analytics', () => {
227227 describe ( '#group' , ( ) => {
228228 it ( 'should enqueue a message' , ( ) => {
229229 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+ } ) ;
231233 assert . deepEqual ( analytics . queue [ 0 ] . message , {
232234 type : 'group' ,
233235 userId : 'user' ,
@@ -258,7 +260,9 @@ describe('Analytics', () => {
258260 describe ( '#track' , ( ) => {
259261 it ( 'should enqueue a message' , ( ) => {
260262 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+ } ) ;
262266 assert . deepEqual ( analytics . queue [ 0 ] . message , {
263267 type : 'track' ,
264268 event : 'event' ,
@@ -271,7 +275,9 @@ describe('Analytics', () => {
271275
272276 it ( 'should handle a user ids given as a number' , ( ) => {
273277 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+ } ) ;
275281 assert . deepEqual ( analytics . queue [ 0 ] . message , {
276282 userId : 1 ,
277283 event : 'jumped the shark' ,
@@ -350,7 +356,9 @@ describe('Analytics', () => {
350356 describe ( '#alias' , ( ) => {
351357 it ( 'should enqueue a message' , ( ) => {
352358 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+ } ) ;
354362 assert . deepEqual ( analytics . queue [ 0 ] . message , {
355363 type : 'alias' ,
356364 previousId : 'previous' ,
0 commit comments