Skip to content

Commit

Permalink
chore: eslint on test
Browse files Browse the repository at this point in the history
  • Loading branch information
neiker committed Oct 22, 2017
1 parent 8666b6d commit 438da05
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'assert';
import Analytics from '../src';
import createServer from './server';

const version = require('../package.json').version;
const { version } = require('../package.json');

let analytics;
const noop = function noop() {};
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('Analytics', () => {
analytics.enqueue('type', { timestamp: date }, noop);

const msg = analytics.queue[0].message;
const callback = analytics.queue[0].callback;
const { callback } = analytics.queue[0];

assert.equal(callback, noop);
assert.equal(msg.type, 'type');
Expand Down Expand Up @@ -227,7 +227,9 @@ describe('Analytics', () => {
describe('#group', () => {
it('should enqueue a message', () => {
const date = new Date();
analytics.group({ groupId: 'group', userId: 'user', timestamp: date, messageId: id });
analytics.group({
groupId: 'group', userId: 'user', timestamp: date, messageId: id,
});
assert.deepEqual(analytics.queue[0].message, {
type: 'group',
userId: 'user',
Expand Down Expand Up @@ -258,7 +260,9 @@ describe('Analytics', () => {
describe('#track', () => {
it('should enqueue a message', () => {
const date = new Date();
analytics.track({ userId: 'id', event: 'event', timestamp: date, messageId: id });
analytics.track({
userId: 'id', event: 'event', timestamp: date, messageId: id,
});
assert.deepEqual(analytics.queue[0].message, {
type: 'track',
event: 'event',
Expand All @@ -271,7 +275,9 @@ describe('Analytics', () => {

it('should handle a user ids given as a number', () => {
const date = new Date();
analytics.track({ userId: 1, event: 'jumped the shark', timestamp: date, messageId: id });
analytics.track({
userId: 1, event: 'jumped the shark', timestamp: date, messageId: id,
});
assert.deepEqual(analytics.queue[0].message, {
userId: 1,
event: 'jumped the shark',
Expand Down Expand Up @@ -350,7 +356,9 @@ describe('Analytics', () => {
describe('#alias', () => {
it('should enqueue a message', () => {
const date = new Date();
analytics.alias({ previousId: 'previous', userId: 'id', timestamp: date, messageId: id });
analytics.alias({
previousId: 'previous', userId: 'id', timestamp: date, messageId: id,
});
assert.deepEqual(analytics.queue[0].message, {
type: 'alias',
previousId: 'previous',
Expand Down

0 comments on commit 438da05

Please sign in to comment.