Gitako/packages/pjax/tests/lib/util/clone.js
EnixCoda 7e6feb621c
revert: use old pjax for Firefox compatibility
This reverts commit 8aaf55be59 and 0a4ee27
2020-04-06 19:16:36 +08:00

17 lines
453 B
JavaScript

var tape = require("tape")
var clone = require("../../../lib/util/clone")
tape("test clone method", function(t) {
var obj = {one: 1, two: 2}
var cloned = clone(obj)
t.notEqual(obj, cloned, "cloned object isn't the original object")
t.same(obj, cloned, "cloned object has the same values as original object")
cloned.three = 3
t.notSame(obj, cloned, "modified cloned object doesn't have the same values as original object")
t.end()
})