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(){
3636
3737describe ( 'String.stripScripts' , function ( ) {
3838
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+
4240
4341 it ( 'should execute the stripped tags from the string' , function ( ) {
4442 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(){
4947 expect ( window . stripScriptsSpec ) . to . equal ( 4242 ) ;
5048 } ) ;
5149
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+
5255} ) ;
5356
5457describe ( 'Document' , function ( ) {
Original file line number Diff line number Diff line change 3737 "grunt-karma" : " ^2.0.0" ,
3838 "grunt-mocha-test" : " ^0.12.7" ,
3939 "grunt-mootools-packager" : " ^0.4.0" ,
40- "karma" : " ^1.7.0 " ,
40+ "karma" : " ^1.7.1 " ,
4141 "karma-expect" : " ^1.1" ,
4242 "karma-mocha" : " ^0.2.0" ,
4343 "karma-phantomjs-launcher" : " ^1.0.4" ,
You can’t perform that action at this time.
0 commit comments