Skip to content

Commit

Permalink
test(csv-issues-cjs): fix stdout maxBuffer length exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Aug 11, 2023
1 parent fc9be37 commit 586ef58
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions demo/issues-cjs/test/samples.coffee
@@ -1,7 +1,7 @@

fs = require 'fs'
path = require 'path'
{ exec } = require 'child_process'
fs = require 'node:fs'
path = require 'node:path'
{ spawn } = require 'node:child_process'

dir = path.resolve __dirname, '../lib'
samples = fs.readdirSync dir
Expand All @@ -14,10 +14,11 @@ describe 'Samples', ->
.map (sample) ->
it "Sample #{sample}", (callback) ->
ext = /\.(\w+)?$/.exec(sample)[0]
bin = switch ext
cmd = switch ext
when '.js'
'node'
when '.ts'
'ts-node' # Also works with: `node --loader ts-node/esm`
exec "#{bin} #{path.resolve dir, sample}", (err) ->
callback err
spawn(cmd, [path.resolve dir, sample])
.on 'close', (code) -> callback(code isnt 0 and new Error 'Failure')
.stdout.on 'data', (->)

0 comments on commit 586ef58

Please sign in to comment.