mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Add test for ProcessTask.
This commit is contained in:
23
spec/stdlib/process-task-shell-spec.coffee
Normal file
23
spec/stdlib/process-task-shell-spec.coffee
Normal file
@@ -0,0 +1,23 @@
|
||||
Task = require 'process-task'
|
||||
|
||||
describe "ProcessTask shell", ->
|
||||
describe "populating the window with fake properties", ->
|
||||
describe "when jQuery is loaded in child process", ->
|
||||
it "doesn't log to the console", ->
|
||||
spyOn(console, 'log')
|
||||
spyOn(console, 'error')
|
||||
spyOn(console, 'warn')
|
||||
class JQueryTask extends Task
|
||||
constructor: -> super('fixtures/jquery-task-handler.coffee')
|
||||
started: -> @callWorkerMethod('load')
|
||||
loaded: (@jqueryLoaded) ->
|
||||
|
||||
task = new JQueryTask()
|
||||
task.start()
|
||||
waitsFor "child process to start and jquery to be required", 5000, ->
|
||||
task.jqueryLoaded
|
||||
runs ->
|
||||
expect(task.jqueryLoaded).toBeTruthy()
|
||||
expect(console.log).not.toHaveBeenCalled()
|
||||
expect(console.error).not.toHaveBeenCalled()
|
||||
expect(console.warn).not.toHaveBeenCalled()
|
||||
Reference in New Issue
Block a user