Blame view

node_modules/msgpack5/test/functions.js 398 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  'use strict'
  
  var test = require('tape').test
  var msgpack = require('../')
  var noop = function () {}
  
  test('encode a function inside a map', function (t) {
    var encoder = msgpack()
    var expected = {
      hello: 'world'
    }
    var toEncode = {
      hello: 'world',
      func: noop
    }
  
    t.deepEqual(encoder.decode(encoder.encode(toEncode)), expected, 'remove the function from the map')
    t.end()
  })