This repository has been archived by the owner on Jul 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from zapier/skip-http-patch
skip http patching
- Loading branch information
Showing
5 changed files
with
45 additions
and
7 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
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const should = require('should'); | ||
|
||
const createAppTester = require('../../src/tools/create-app-tester'); | ||
const appDefinition = require('../userapp'); | ||
|
||
describe.skip('create-lambda-handler', () => { | ||
// this block is skipped because there's no way to un-modify 'http' once we've done it | ||
// I've verified that the bottom test works in isolation, but doesn't when it's part of the larger suite | ||
describe('http patch', () => { | ||
it('should patch by default', async () => { | ||
const appTester = createAppTester(appDefinition); | ||
await appTester(appDefinition.resources.list.list.operation.perform); | ||
const http = require('http'); // core modules are never cached | ||
should(http.patchedByZapier).eql(true); | ||
}); | ||
|
||
it('should be ablet opt out of patch', async () => { | ||
const appTester = createAppTester({ | ||
...appDefinition, | ||
flags: { skipHttpPatch: true } | ||
}); | ||
await appTester(appDefinition.resources.list.list.operation.perform); | ||
const http = require('http'); // core modules are never cached | ||
should(http.patchedByZapier).eql(undefined); | ||
}); | ||
}); | ||
}); |