Fix #873, regenerate minified variants.

Drive-by fix: uppercase tag name in failing m.trust test (doesn't make it
pass, though).
This commit is contained in:
impinball 2015-12-10 18:52:51 -05:00
parent 747ba7e6d9
commit cb29a21ec3
5 changed files with 49 additions and 14 deletions

View file

@ -345,4 +345,40 @@ describe("m.request()", function () {
expect(req()).to.eql({foo: "bar1"})
})
})
it("ends the computation when a SyntaxError is thrown from `options.extract`", function () { // eslint-disable-line max-len
var root = mock.document.createElement("div")
var viewSpy = sinon.spy(function () { return m("div") })
var resolved = sinon.spy()
var rejected = sinon.spy()
m.mount(root, {
controller: function () {
m.request({
url: "/test",
extract: function () {
throw new SyntaxError()
}
}).then(resolved, rejected)
},
view: viewSpy
})
// For good measure
mock.requestAnimationFrame.$resolve()
expect(function () {
resolve()
}).to.throw()
expect(resolved).to.not.have.been.called
expect(rejected).to.not.have.been.called
// The controller should throw, but the view should still render.
expect(viewSpy).to.have.been.called
// For good measure
mock.requestAnimationFrame.$resolve()
})
})

View file

@ -52,7 +52,7 @@ describe("m.trust()", function () {
m("td", "foo")
])
expect(root.childNodes[2].tagName).to.equal("td")
expect(root.childNodes[2].tagName).to.equal("TD")
})
})
})