Skip to content

Commit 9cbde99

Browse files
Ignoring a test in IE9, since it doesn't allow setting custom HTTP headers
1 parent 7438237 commit 9cbde99

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

tests/fixtures/globals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
window.userAgent = {
1717
isNode: false,
1818
isBrowser: true,
19+
isOldIE: navigator.userAgent.indexOf('MSIE') >= 0,
1920
isKarma: !!window.__karma__
2021
};
2122
}

tests/specs/http/http.spec.js

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,26 @@ describe('HTTP options', function() {
3535
.catch(done);
3636
});
3737

38-
it('should set custom HTTP headers', function(done) {
39-
testDone = done;
40-
var parser = new $RefParser();
38+
// Old versions of IE don't allow setting custom headers
39+
if (!userAgent.isOldIE) {
40+
it('should set custom HTTP headers', function(done) {
41+
testDone = done;
42+
var parser = new $RefParser();
4143

42-
parser.parse('http://httpbin.org/headers', {
43-
http: {
44-
headers: {
45-
'my-custom-header': 'hello, world'
44+
parser.parse('http://httpbin.org/headers', {
45+
http: {
46+
headers: {
47+
'my-custom-header': 'hello, world'
48+
}
4649
}
47-
}
48-
})
49-
.then(function(schema) {
50-
expect(schema.headers).to.have.property('My-Custom-Header', 'hello, world');
51-
done();
52-
})
53-
.catch(done);
54-
});
50+
})
51+
.then(function(schema) {
52+
expect(schema.headers).to.have.property('My-Custom-Header', 'hello, world');
53+
done();
54+
})
55+
.catch(done);
56+
});
57+
}
5558
});
5659

5760
describe('options.http.redirect', function() {

0 commit comments

Comments
 (0)