UNPKG

streamer-client

Version:

A node.js client for the Duke OIT Streamer API

22 lines (20 loc) 535 B
var assert = require('assert'); var util = require('../lib/util'); describe('Util', function() { describe('#keyMap', function() { it('should map the appropriate keys from strings to numbers', function() { var obj = { "key1": "1", "key2": "2", "key3": "3", }; var shouldEqual = { "key1": 1, "key2": 2, "key3": "3", }; var transformed = util.keyMap(obj, ["key1", "key2"], parseInt); assert.deepEqual(transformed, shouldEqual); }); }); });