Skip to content

Commit 85b8bb9

Browse files
authored
Merge pull request dherault#250 from franciscocpg/disable-node-socket-timeout
Disabling node socket timeout
2 parents d2d4536 + 9afa64d commit 85b8bb9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
33
- node
4+
- '7'
45
- '6'
56
- '5'
67
- '4.3.2'

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ class Offline {
330330
const funName = key;
331331
const servicePath = path.join(this.serverless.config.servicePath, this.options.location);
332332
const funOptions = functionHelper.getFunctionOptions(fun, key, servicePath);
333+
debugLog(`funOptions ${JSON.stringify(funOptions, null, 2)} `);
333334

334335
this.printBlankLine();
335336
debugLog(funName, 'runtime', serviceRuntime, funOptions.babelOptions || '');
@@ -386,6 +387,7 @@ class Offline {
386387
const routeConfig = {
387388
cors,
388389
auth: authStrategyName,
390+
timeout: { socket: false },
389391
};
390392

391393
if (routeMethod !== 'HEAD' && routeMethod !== 'GET') {

test/integration/offline.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('Offline', () => {
116116

117117
offLine.inject('/index', res => {
118118
expect(res.headers['content-type']).to.contains('text/html');
119-
expect(res.statusCode).to.eq('200');
119+
expect(res.statusCode).to.satisfy(status => status === 200 || status === '200');
120120
done();
121121
});
122122
});
@@ -142,7 +142,7 @@ describe('Offline', () => {
142142

143143
offLine.inject('/index', res => {
144144
expect(res.headers['content-type']).to.contains('text/html');
145-
expect(res.statusCode).to.eq('500');
145+
expect(res.statusCode).to.satisfy(status => status === 500 || status === '500');
146146
done();
147147
});
148148
});
@@ -167,7 +167,7 @@ describe('Offline', () => {
167167

168168
offLine.inject('/index', res => {
169169
expect(res.headers['content-type']).to.contains('text/html');
170-
expect(res.statusCode).to.eq('401');
170+
expect(res.statusCode).to.satisfy(status => status === 401 || status === '401');
171171
done();
172172
});
173173
});

0 commit comments

Comments
 (0)