pulsar/spec/buffered-node-process-spec.coffee
Kevin Sawicki 6e3d41f433 Suppress deprecations in BufferedNodeProcess
This keeps it consistent with the render process which also suppresses
deprecations

Closes #5383
2015-02-04 15:27:17 -08:00

40 lines
1.1 KiB
CoffeeScript

path = require 'path'
BufferedNodeProcess = require '../src/buffered-node-process'
describe "BufferedNodeProcess", ->
it "executes the script in a new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
args = ['hi']
command = path.join(__dirname, 'fixtures', 'script.js')
new BufferedNodeProcess({command, args, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''
expect(args).toEqual ['hi']
it "suppresses deprecations in the new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
command = path.join(__dirname, 'fixtures', 'script-with-deprecations.js')
new BufferedNodeProcess({command, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''