File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,17 @@ module.exports = function (grunt) {
4242 'test/fixtures/file2.js'
4343 ]
4444 }
45+ } ,
46+
47+ folderDest : {
48+ options : {
49+ } ,
50+ files : {
51+ 'tmp/' : [
52+ 'test/fixtures/file3.js' ,
53+ 'test/fixtures/folder/file4.js'
54+ ]
55+ }
4556 }
4657 } ,
4758
Original file line number Diff line number Diff line change 1+ function ask ( what ) {
2+ var upper = what . toUpperCase ( ) ;
3+ return upper + '?' ;
4+ }
5+ module . exports = ask ;
Original file line number Diff line number Diff line change 1+ function doubt ( what ) {
2+ var upper = what . toLowerCase ( ) ;
3+ return upper + '...' ;
4+ }
5+ module . exports = doubt ;
Original file line number Diff line number Diff line change @@ -41,6 +41,24 @@ exports.obfuscator = {
4141 // tests whether the obfuscation worked
4242 test . ok ( result . indexOf ( 'Forty Two' ) === - 1 ) ;
4343
44+ test . done ( ) ;
45+ } ,
46+ folderDest : function ( test ) {
47+ test . expect ( 4 ) ;
48+
49+ var result1 = readFile ( 'tmp/test/fixtures/file3.js' ) ;
50+ var result2 = readFile ( 'tmp/test/fixtures/folder/file4.js' ) ;
51+
52+ var ask = eval ( result1 ) ;
53+ test . equal ( ask ( 'Hello World' ) , 'HELLO WORLD?' ) ;
54+
55+ var doubt = eval ( result2 ) ;
56+ test . equal ( doubt ( 'Hello World' ) , 'hello world...' ) ;
57+
58+ // tests whether the obfuscation worked
59+ test . ok ( result1 . indexOf ( 'toUpperCase' ) === - 1 ) ;
60+ test . ok ( result2 . indexOf ( 'toLowerCase' ) === - 1 ) ;
61+
4462 test . done ( ) ;
4563 }
4664} ;
You can’t perform that action at this time.
0 commit comments