-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing tests for browser support #34
- Loading branch information
Showing
15 changed files
with
201 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"after": true, | ||
"afterEach": true, | ||
"describe": true, | ||
"it": true | ||
"it": true, | ||
"window": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
var chakram = require('./../../lib/chakram.js'), | ||
expect = chakram.expect; | ||
var testsRunningInNode = (typeof global !== "undefined" ? true : false), | ||
chakram = (testsRunningInNode ? global.chakram : window.chakram), | ||
expect = (testsRunningInNode ? global.expect : window.expect); | ||
|
||
describe("Chakram Assertions", function() { | ||
|
||
describe("Compression", function() { | ||
|
||
it("should allow assertions on uncompressed responses", function () { | ||
var noncompressed = chakram.get("http://httpbin.org/get"); | ||
expect(noncompressed).not.to.be.encoded.with.gzip; | ||
expect(noncompressed).not.to.be.encoded.with.deflate; | ||
return chakram.wait(); | ||
}); | ||
|
||
it("should detect gzip compression", function () { | ||
var gzip = chakram.get("http://httpbin.org/gzip"); | ||
expect(gzip).to.be.encoded.with.gzip; | ||
expect(gzip).not.to.be.encoded.with.deflate; | ||
return chakram.wait(); | ||
}); | ||
|
||
it("should detect deflate compression", function () { | ||
var deflate = chakram.get("http://httpbin.org/deflate"); | ||
expect(deflate).not.to.be.encoded.with.gzip; | ||
expect(deflate).to.be.encoded.with.deflate; | ||
return chakram.wait(); | ||
}); | ||
|
||
it("should support shorter language chains", function () { | ||
var deflate = chakram.get("http://httpbin.org/deflate"); | ||
expect(deflate).not.to.be.gzip; | ||
expect(deflate).to.be.deflate; | ||
return chakram.wait(); | ||
}); | ||
}); | ||
}); | ||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.