Skip to content

Commit

Permalink
Ensure fetch works in node 8
Browse files Browse the repository at this point in the history
- Remove the use of finally.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally#Browser_compatibility
- Increase timeouts because test became flakely otherwise
  • Loading branch information
rmeritz committed Jun 18, 2020
1 parent 0c90b8f commit d7d6235
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/run_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function runAction(base, method, path, queryParams, bodyData, callback, numAttem
.catch(callback);
}
})
.catch(callback)
.finally(function() {
.catch(function(error) {
clearTimeout(timeout);
callback(error);
});
}

Expand Down
4 changes: 2 additions & 2 deletions test/find.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ describe('record retrival', function() {
var testExpressApp;
var teardownAsync;

beforeAll(function() {
beforeEach(function() {
return testHelpers.getMockEnvironmentAsync().then(function(env) {
airtable = env.airtable;
testExpressApp = env.testExpressApp;
teardownAsync = env.teardownAsync;
});
});

afterAll(function() {
afterEach(function() {
delete global.window;
return teardownAsync();
});
Expand Down
2 changes: 1 addition & 1 deletion test/test_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function getMockEnvironmentAsync(options) {
airtable: new Airtable({
apiKey: 'key123',
endpointUrl: 'http://localhost:' + testServerPort,
requestTimeout: 100,
requestTimeout: 1000,
}),
teardownAsync: util.promisify(testServer.close.bind(testServer)),
testExpressApp: app,
Expand Down

0 comments on commit d7d6235

Please sign in to comment.