Skip to content

Commit

Permalink
chore: fix tests for node<12
Browse files Browse the repository at this point in the history
  • Loading branch information
commenthol committed Dec 6, 2019
1 parent 89c82a8 commit 8d16443
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,7 @@ language: node_js
node_js:
- 8
- 10
- 12
- node

script:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,4 +1,4 @@
all: readme v4. v6. v8. v9.
all: readme v8 v10 v12 v13

readme: README.md
markedpp --githubid -i $< -o $<
Expand Down
6 changes: 5 additions & 1 deletion test/fixtures.js
Expand Up @@ -6,6 +6,8 @@ function log (arg) {
console.log(JSON.stringify(arg))
}

const isLessV13 = parseInt(process.versions.node.split('.')[0]) < 12

module.exports = {
'string': [
"string's\n\"new\" line",
Expand Down Expand Up @@ -141,7 +143,9 @@ module.exports = {
],
'regexXss': [
/[</script><script>alert('xss')//]/i,
'new RegExp("[</script><script>alert(\'xss\')//]", "i")'
isLessV13
? 'new RegExp("[<\\/script><script>alert(\'xss\')\\/\\/]", "i")'
: 'new RegExp("[</script><script>alert(\'xss\')//]", "i")'
],
'regex no flags': [
/abc/,
Expand Down

0 comments on commit 8d16443

Please sign in to comment.