mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-14 04:29:04 +03:00
6e3d41f433
This keeps it consistent with the render process which also suppresses deprecations Closes #5383
40 lines
1.1 KiB
CoffeeScript
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 ''
|