Add JSON.stringify test.

This commit is contained in:
John-David Dalton
2014-04-08 00:44:20 -07:00
parent 68729a9696
commit 79ec1f5a02

View File

@@ -28,7 +28,9 @@
push = Array.prototype.push,
slice = Array.prototype.slice,
system = root.system,
toString = Object.prototype.toString,
toString = Object.prototype.toString;
var JSON = root.JSON,
Worker = document && root.Worker;
/** The file path of the Lo-Dash file to test */
@@ -9656,6 +9658,16 @@
}
});
test('should stringify the wrapped value when passed to `JSON.stringify`', 1, function() {
if (!isNpm && JSON) {
var wrapped = _([1, 2, 3]);
strictEqual(JSON.stringify(wrapped), '[1,2,3]');
}
else {
skipTest();
}
});
test('should be aliased', 2, function() {
if (!isNpm) {
var expected = _.prototype.valueOf;