Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Tests: More failing </script> fun
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnor committed Aug 22, 2016
1 parent f2eb86a commit dd89ef5
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion spec/runner.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ describe 'Runner', ->
chai.expect(err.message).to.contain 'TIMEOUT'
done()

describe 'input data containing </script>', ->
describe 'input data containing <script>...</script>', ->
it 'should succeed', (done) ->
filter = local 'return-input'
input = { 'foo': 'barbaz', 'htmlscript': '<script>alert("Works!")</script>' }
Expand All @@ -376,6 +376,26 @@ describe 'Runner', ->
chai.expect(solution).to.eql input
done()

describe 'input data containing </script>...<script>', ->
it 'should succeed', (done) ->
filter = local 'return-input'
input = { 'foo': 'barbaz', 'htmlbogusscript': '</script> <script>alert("Works!")</script> <script>' }
options = {}
solver.runJob filter, input, options, (err, solution, details) ->
chai.expect(err).to.not.exist
chai.expect(solution).to.eql input
done()

describe 'input data containing HTML comment', ->
it 'should succeed', (done) ->
filter = local 'return-input'
input = { 'foo': 'barbaz', 'htmlcomment': '<!-- FFOO -->' }
options = {}
solver.runJob filter, input, options, (err, solution, details) ->
chai.expect(err).to.not.exist
chai.expect(solution).to.eql input
done()

describe 'filter with infinite loop', ->
it 'should timeout and return error', (done) ->
@timeout 9000
Expand Down

0 comments on commit dd89ef5

Please sign in to comment.