@@ -36,7 +36,7 @@ const customProbes = [
3636] ;
3737
3838test ( "should append to list of probes (default)" , ( ) => {
39- const analyser = new AstAnalyser ( { parser : new JsSourceParser ( ) , customProbe : customProbes } ) ;
39+ const analyser = new AstAnalyser ( { customParser : new JsSourceParser ( ) , customProbes } ) ;
4040 const result = analyser . analyse ( kIncriminedCodeSample ) ;
4141
4242 assert . equal ( result . warnings [ 0 ] . kind , kWarningUnsafeDanger ) ;
@@ -46,17 +46,27 @@ test("should append to list of probes (default)", () => {
4646} ) ;
4747
4848test ( "should replace list of probes" , ( ) => {
49- const analyser = new AstAnalyser ( { parser : new JsSourceParser ( ) , customProbe : customProbes , isReplacing : true } ) ;
49+ const analyser = new AstAnalyser ( {
50+ parser : new JsSourceParser ( ) ,
51+ customProbes,
52+ skipDefaultProbes : true
53+ } ) ;
5054 const result = analyser . analyse ( kIncriminedCodeSample ) ;
5155
56+ console . log ( analyser ) ;
57+
5258 assert . equal ( result . warnings [ 0 ] . kind , kWarningUnsafeDanger ) ;
5359 assert . equal ( result . warnings . length , 1 ) ;
5460} ) ;
5561
5662test ( "should append list of probes using runASTAnalysis" , ( ) => {
5763 const result = runASTAnalysis (
5864 kIncriminedCodeSample ,
59- { parser : new JsSourceParser ( ) , customProbe : customProbes , isReplacing : false }
65+ {
66+ parser : new JsSourceParser ( ) ,
67+ customProbes,
68+ skipDefaultProbes : false
69+ }
6070 ) ;
6171
6272 assert . equal ( result . warnings [ 0 ] . kind , kWarningUnsafeDanger ) ;
@@ -68,7 +78,11 @@ test("should append list of probes using runASTAnalysis", () => {
6878test ( "should replace list of probes using runASTAnalysis" , ( ) => {
6979 const result = runASTAnalysis (
7080 kIncriminedCodeSample ,
71- { parser : new JsSourceParser ( ) , customProbe : customProbes , isReplacing : true }
81+ {
82+ parser : new JsSourceParser ( ) ,
83+ customProbes,
84+ skipDefaultProbes : true
85+ }
7286 ) ;
7387
7488 assert . equal ( result . warnings [ 0 ] . kind , kWarningUnsafeDanger ) ;
0 commit comments