File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,7 @@ describe('Browser.exec', function(){
36
36
37
37
describe ( 'String.stripScripts' , function ( ) {
38
38
39
- it ( 'should strip all script tags from a string' , function ( ) {
40
- expect ( '<div><script type="text/javascript" src="file.js"></script></div>' . stripScripts ( ) ) . to . equal ( '<div></div>' ) ;
41
- } ) ;
39
+
42
40
43
41
it ( 'should execute the stripped tags from the string' , function ( ) {
44
42
expect ( '<div><script type="text/javascript"> var stripScriptsSpec = 42; </script></div>' . stripScripts ( true ) ) . to . equal ( '<div></div>' ) ;
@@ -49,6 +47,11 @@ describe('String.stripScripts', function(){
49
47
expect ( window . stripScriptsSpec ) . to . equal ( 4242 ) ;
50
48
} ) ;
51
49
50
+ it ( 'should not execute json scripts' , function ( ) {
51
+ expect ( '<div><script type="application/json">var stripScriptsSpec424242 = 424242;</script></div>' . stripScripts ( ) ) . to . equal ( '<div></div>' ) ;
52
+ expect ( window . stripScriptsSpec424242 ) . to . equal ( undefined ) ;
53
+ } ) ;
54
+
52
55
} ) ;
53
56
54
57
describe ( 'Document' , function ( ) {
Original file line number Diff line number Diff line change 37
37
"grunt-karma" : " ^2.0.0" ,
38
38
"grunt-mocha-test" : " ^0.12.7" ,
39
39
"grunt-mootools-packager" : " ^0.4.0" ,
40
- "karma" : " ^1.7.0 " ,
40
+ "karma" : " ^1.7.1 " ,
41
41
"karma-expect" : " ^1.1" ,
42
42
"karma-mocha" : " ^0.2.0" ,
43
43
"karma-phantomjs-launcher" : " ^1.0.4" ,
You can’t perform that action at this time.
0 commit comments