non mapped responseHandling config will not swap7ms ‣
var originalResponseHandling = htmx.config.responseHandling
try {
htmx.config.responseHandling = [{ code: '200', swap: true }]
var responseCode = null
this.server.respondWith('GET', '/test', function(xhr, id) {
xhr.respond(responseCode, { 'Content-Type': 'text/html' }, '' + responseCode)
})
responseCode = 400
var btn = make('<button hx-get="/test">Click Me!</button>')
btn.click()
this.server.respond()
btn.innerHTML.should.equal('Click Me!')
responseCode = 200
var btn = make('<button hx-get="/test">Click Me!</button>')
btn.click()
this.server.respond()
btn.innerHTML.should.equal('200')
} finally {
htmx.config.responseHandling = originalResponseHandling
}