-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: capture
bind
s, support minArgsToTrigger
- Loading branch information
1 parent
c8a91cf
commit 29cb0c6
Showing
7 changed files
with
147 additions
and
57 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 @@ | ||
const http = require('http'); | ||
const Sandworm = require('../../dist/index'); | ||
const {expectNoCall, loadSandworm, expectCallToMatch} = require('../utils'); | ||
|
||
describe('bind', () => { | ||
beforeAll(loadSandworm); | ||
afterEach(() => Sandworm.clearHistory()); | ||
|
||
test('args', async () => { | ||
http.request.bind(this); | ||
expectNoCall(); | ||
|
||
http.request.bind(this, []); | ||
expectCallToMatch({family: 'bind', method: 'args'}); | ||
}); | ||
}); |
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,11 @@ | ||
const http = require('http'); | ||
const {loadSandwormInProductionMode, expectCallToThrow} = require('../utils'); | ||
|
||
describe('enforce: bind', () => { | ||
beforeAll(loadSandwormInProductionMode); | ||
|
||
test('args', () => { | ||
http.request.bind(this); | ||
expectCallToThrow(() => http.request.bind(this, {})); | ||
}); | ||
}); |
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