Fix bugs and add tests (#145)
* Fix bug when checking if elements were parsed already
parse-element.js checks if the element was already parsed by
checking for the `data-pjax-click-state` attribute. However, this
attribute was not added until the link is clicked.
Originally, there was a separate attribute, `data-pjax-enabled`,
which tracked if the element was parsed already, but that was
changed in 9a86044.
This commit merges the attributes for mouse clicks and key presses
into one and adds that attribute when the element is initially
parsed.
* More bug fixes
* Fix documentation for currentUrlFullReload
* Ignore lines from coverage if they can't be tested
* Refactor attach-link and attach-form
* Fix and refactors tests
* Add tests
* Add TS definitions for options.requestOptions
* Code cleanup
This commit was merged in pull request #145.
This commit is contained in:
@@ -4,13 +4,14 @@ var extend = require("../../../lib/util/extend")
|
||||
|
||||
tape("test extend method", function(t) {
|
||||
var obj = {one: 1, two: 2}
|
||||
|
||||
var extended = extend({}, obj, {two: "two", three: 3})
|
||||
|
||||
t.notEqual(obj, extended, "extended object isn't the original object")
|
||||
|
||||
t.notSame(obj, extended, "extended object doesn't have the same values as original object")
|
||||
|
||||
t.notSame(obj.two, extended.two, "extended object value overwrites value from original object")
|
||||
|
||||
extended = extend(null)
|
||||
t.equals(extended, null, "passing null returns null")
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
9
tests/lib/util/noop.js
Normal file
9
tests/lib/util/noop.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var tape = require("tape")
|
||||
|
||||
var noop = require("../../../lib/util/noop")
|
||||
|
||||
tape("test noop function", function(t) {
|
||||
t.equal(typeof noop, "function", "noop is a function")
|
||||
t.equal(noop(), undefined, "noop() returns nothing")
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user