mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Add JSON.stringify test.
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user