@@ -222,11 +222,11 @@ buildDocs = (watch = no) ->
222
222
markdownRenderer = require (' markdown-it' )
223
223
html : yes
224
224
typographer : yes
225
- highlight : (str , lang ) ->
225
+ highlight : (str , language ) ->
226
226
# From https://github.com/markdown-it/markdown-it#syntax-highlighting
227
- if lang and hljs .getLanguage (lang )
227
+ if language and hljs .getLanguage (language )
228
228
try
229
- return hljs .highlight (lang, str ).value
229
+ return hljs .highlight (str, { language } ).value
230
230
catch ex
231
231
return ' ' # No syntax highlighting
232
232
@@ -502,7 +502,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
502
502
# version of the browser compiler. There’s no reason to run this test in old
503
503
# versions of Node (the runtime is the headless Chrome browser, not Node),
504
504
# and Puppeteer 3 only supports Node >= 10.18.1, so limit this test to those
505
- # versions. The code below uses `Promise.prototype.finally` because the
505
+ # versions. The code below uses `Promise.prototype.finally` because the
506
506
# CoffeeScript codebase currently maintains compatibility with Node 6, which
507
507
# did not support `async`/`await` syntax. Even though this test doesn’t run
508
508
# in Node 6, it needs to still _parse_ in Node 6 so that this file can load.
@@ -537,7 +537,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
537
537
page = pageHandle
538
538
page .goto ' http://localhost:8080/'
539
539
).then (->
540
- page .waitFor ' #result' ,
540
+ page .waitForSelector ' #result' ,
541
541
visible : yes
542
542
polling : ' mutation'
543
543
).then ((element ) ->
@@ -548,7 +548,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
548
548
browser .close ()
549
549
).finally ->
550
550
server .close ()
551
- if result and ' failed ' not in result
551
+ if result and not result . includes ( ' failed ' )
552
552
log result, green
553
553
else
554
554
log result, red
@@ -570,6 +570,9 @@ task 'test:integrations', 'test the module integrated with other libraries and e
570
570
# can be built by such tools; if such a build succeeds, it verifies that no
571
571
# Node modules are required as part of the compiler (as opposed to the tests)
572
572
# and that therefore the compiler will run in a browser environment.
573
+ # Webpack 5 requires Node >= 10.13.0.
574
+ [major , minor ] = process .versions .node .split (' .' ).map (n) -> parseInt (n, 10 )
575
+ return if major < 10 or (major is 10 and minor < 13 )
573
576
tmpdir = os .tmpdir ()
574
577
webpack = require ' webpack'
575
578
webpack {
@@ -594,7 +597,7 @@ task 'test:integrations', 'test the module integrated with other libraries and e
594
597
process .exit 1
595
598
596
599
builtCompiler = path .join tmpdir, ' coffeescript.js'
597
- CoffeeScript = require builtCompiler
600
+ { CoffeeScript } = require builtCompiler
598
601
global .testingBrowser = yes
599
602
testResults = runTests CoffeeScript
600
603
fs .unlinkSync builtCompiler
0 commit comments