@@ -5,14 +5,21 @@ const proxyquire = require('proxyquire')
5
5
6
6
describe ( 'IAST TaintTracking' , ( ) => {
7
7
let taintTracking
8
+ const config = {
9
+ iast : {
10
+ maxConcurrentRequests : 2
11
+ }
12
+ }
13
+
8
14
const rewriter = {
9
15
enableRewriter : sinon . spy ( ) ,
10
16
disableRewriter : sinon . spy ( )
11
17
}
12
18
13
19
const taintTrackingOperations = {
14
20
enableTaintOperations : sinon . spy ( ) ,
15
- disableTaintOperations : sinon . spy ( )
21
+ disableTaintOperations : sinon . spy ( ) ,
22
+ setMaxTransactions : sinon . spy ( )
16
23
}
17
24
18
25
const taintTrackingPlugin = {
@@ -31,10 +38,12 @@ describe('IAST TaintTracking', () => {
31
38
afterEach ( sinon . restore )
32
39
33
40
it ( 'Should enable rewriter, taint tracking operations and plugin' , ( ) => {
34
- taintTracking . enableTaintTracking ( )
41
+ taintTracking . enableTaintTracking ( config . iast )
35
42
expect ( rewriter . enableRewriter ) . to . be . calledOnce
36
43
expect ( taintTrackingOperations . enableTaintOperations ) . to . be . calledOnce
37
44
expect ( taintTrackingPlugin . enable ) . to . be . calledOnce
45
+ expect ( taintTrackingOperations . setMaxTransactions )
46
+ . to . have . been . calledOnceWithExactly ( config . iast . maxConcurrentRequests )
38
47
} )
39
48
40
49
it ( 'Should disable both rewriter, taint tracking operations, plugin' , ( ) => {
0 commit comments