map-tojson
Version:
ES7 Proposal: Map#toJSON https://github.com/DavidBruant/Map-Set.prototype.toJSON
18 lines (13 loc) • 446 B
JavaScript
var toJSON = require('../');
var test = require('tape');
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad Map/this value', function (st) {
st['throws'](function () { return toJSON(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return toJSON(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
runTests(toJSON, t);
t.end();
});
;