mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +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,
|
push = Array.prototype.push,
|
||||||
slice = Array.prototype.slice,
|
slice = Array.prototype.slice,
|
||||||
system = root.system,
|
system = root.system,
|
||||||
toString = Object.prototype.toString,
|
toString = Object.prototype.toString;
|
||||||
|
|
||||||
|
var JSON = root.JSON,
|
||||||
Worker = document && root.Worker;
|
Worker = document && root.Worker;
|
||||||
|
|
||||||
/** The file path of the Lo-Dash file to test */
|
/** 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() {
|
test('should be aliased', 2, function() {
|
||||||
if (!isNpm) {
|
if (!isNpm) {
|
||||||
var expected = _.prototype.valueOf;
|
var expected = _.prototype.valueOf;
|
||||||
|
|||||||
Reference in New Issue
Block a user