@@ -32,28 +32,23 @@ describe('StringArrayNode', () => {
32
32
} ) ;
33
33
} ) ;
34
34
35
- it ( 'should correctly append `StringArrayNode` custom node into the obfuscated code if `stringArray` option is set' , ( ) => {
36
- let obfuscationResult : IObfuscationResult = JavaScriptObfuscator . obfuscate (
37
- readFileAsString ( __dirname + '/fixtures/simple-input.js' ) ,
38
- {
39
- ...NO_CUSTOM_NODES_PRESET ,
40
- stringArray : true ,
41
- stringArrayThreshold : 1
42
- }
43
- ) ;
44
-
45
- assert . match ( obfuscationResult . getObfuscatedCode ( ) , / ^ v a r _ 0 x ( [ a - f 0 - 9 ] ) { 4 } * = * \[ / ) ;
46
- } ) ;
35
+ describe ( '`stringArray` option isn\'t set' , ( ) => {
36
+ let obfuscatedCode : string ;
47
37
48
- it ( 'should\'t append `StringArrayNode` custom node into the obfuscated code if `stringArray` option is not set' , ( ) => {
49
- let obfuscationResult : IObfuscationResult = JavaScriptObfuscator . obfuscate (
50
- readFileAsString ( __dirname + '/fixtures/simple-input.js' ) ,
51
- {
52
- ...NO_CUSTOM_NODES_PRESET ,
53
- stringArray : false
54
- }
55
- ) ;
38
+ before ( ( ) => {
39
+ let obfuscationResult : IObfuscationResult = JavaScriptObfuscator . obfuscate (
40
+ readFileAsString ( __dirname + '/fixtures/simple-input.js' ) ,
41
+ {
42
+ ...NO_CUSTOM_NODES_PRESET ,
43
+ stringArray : false
44
+ }
45
+ ) ;
46
+
47
+ obfuscatedCode = obfuscationResult . getObfuscatedCode ( ) ;
48
+ } ) ;
56
49
57
- assert . notMatch ( obfuscationResult . getObfuscatedCode ( ) , / ^ v a r _ 0 x ( [ a - f 0 - 9 ] ) { 4 } * = * \[ / ) ;
50
+ it ( 'shouldn\'t append custom node into the obfuscated code' , ( ) => {
51
+ assert . notMatch ( obfuscatedCode , regExp ) ;
52
+ } ) ;
58
53
} ) ;
59
54
} ) ;
0 commit comments