UNPKG

election-utils

Version:

This module provides various utility functions for dealing with AP election data.

13 lines (9 loc) 351 B
const test = require('tape') const formatTimestamp = require('./../build/index.js').formatTimestamp const fs = require('fs') test('formatTimestamp', (assert) => { const file = fs.readFileSync('./test/fixtures/in/20160301-MA.json', 'utf8') const json = JSON.parse(file) assert.equal(formatTimestamp(json), 'Mar. 1, 3:46 PM EST') assert.end() })