Skip to content

Commit

Permalink
test: improve test cases for decompress
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Sep 19, 2023
1 parent b40a596 commit f4a4954
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ describe('httpx', () => {
it('compression should ok', async function () {
var res = await make(server)('/compression');
assert.strictEqual(res.statusCode, 200);
assert.strictEqual(res.headers['content-encoding'], 'gzip');
var result = await httpx.read(res, 'utf8');
assert.strictEqual(result, 'Hello world with gzip!');
});

it('compression with deflate should ok', async function () {
var res = await make(server)('/compression_with_deflate');
assert.strictEqual(res.statusCode, 200);
assert.strictEqual(res.headers['content-encoding'], 'deflate');
var result = await httpx.read(res, 'utf8');
assert.strictEqual(result, 'Hello world with deflate!');
});
Expand All @@ -99,7 +101,7 @@ describe('httpx', () => {
assert.ok(false, 'should not ok');
});

it('timeout should ok', async function () {
it('timeout(readTimeout) should ok', async function () {
try {
await make(server)('/readTimeout', {readTimeout: 100, connectTimeout: 50});
} catch (ex) {
Expand All @@ -111,7 +113,7 @@ describe('httpx', () => {
assert.ok(false, 'should not ok');
});

it('timeout should ok', async function () {
it('timeout(readTimeout & timeout) should ok', async function () {
try {
await make(server)('/readTimeout', {readTimeout: 100, connectTimeout: 50, timeout: 300});
} catch (ex) {
Expand Down

0 comments on commit f4a4954

Please sign in to comment.