mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
25 lines
641 B
JavaScript
Executable File
25 lines
641 B
JavaScript
Executable File
/* global it */
|
|
|
|
'use strict';
|
|
|
|
require('should');
|
|
|
|
module.exports = function(HTTPSnippet, fixtures) {
|
|
it('should not use cors', function() {
|
|
var result = new HTTPSnippet(fixtures.requests.short).convert(
|
|
'javascript',
|
|
'xhr',
|
|
{
|
|
cors: false
|
|
}
|
|
);
|
|
|
|
result.should.be.a.String;
|
|
result
|
|
.replace(/\n/g, '')
|
|
.should.eql(
|
|
'var data = null;var xhr = new XMLHttpRequest();xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); }});xhr.open("GET", "http://mockbin.com/har");xhr.send(data);'
|
|
);
|
|
});
|
|
};
|