Skip to content

Commit

Permalink
attempt to fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Aug 8, 2021
1 parent 3fbc735 commit bb4ae37
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/js-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,13 @@ let serveTests = {
const buffer = await fetch(result.host, result.port, '/out.js')
assert.strictEqual(buffer.toString(), `console.log(123);\n`);

let singleRequest = await singleRequestPromise;
assert.strictEqual(singleRequest.method, 'GET');
assert.strictEqual(singleRequest.path, '/out.js');
assert.strictEqual(singleRequest.status, 200);
assert.strictEqual(typeof singleRequest.remoteAddress, 'string');
assert.strictEqual(typeof singleRequest.timeInMS, 'number');

try {
await fetch(result.host, result.port, '/in.js')
throw new Error('Expected a 404 error for "/in.js"')
Expand All @@ -2668,13 +2675,6 @@ let serveTests = {
throw err
}

let singleRequest = await singleRequestPromise;
assert.strictEqual(singleRequest.method, 'GET');
assert.strictEqual(singleRequest.path, '/out.js');
assert.strictEqual(singleRequest.status, 200);
assert.strictEqual(typeof singleRequest.remoteAddress, 'string');
assert.strictEqual(typeof singleRequest.timeInMS, 'number');

result.stop();
await result.wait;
},
Expand Down

0 comments on commit bb4ae37

Please sign in to comment.