Skip to content

Commit

Permalink
Style.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Sep 20, 2019
1 parent a4044e8 commit 3265536
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions tests.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -928,11 +928,11 @@ for idGeneration in ['STRING', 'MONGO']
ClassyTestCase.addTest new ReactivePublishTestCase()

if Meteor.isServer
Meteor.publish "initial error", () ->
Meteor.publish "initial error", ->
@autorun () =>
throw new Meteor.Error('triggered error')

Meteor.publish "rereun error", () ->
Meteor.publish "rereun error", ->
reactiveError = new ReactiveVar false

@autorun () =>
Expand All @@ -943,23 +943,19 @@ if Meteor.isServer
@ready()

class ReactivePublishErrorTests extends ClassyTestCase
@testName: "reactivepublish - Errors"
@testName: "reactivepublish - errors"

testClientInitialError: () ->
sub = Meteor.subscribe("initial error", {
onStop: (error) =>
@assertEqual(error.message, '[triggered error]')
})
testClientInitialError: ->
@assertSubscribeFails "initial error", @expect()

testClientRerunError: () ->
testClientRerunError: ->
isReady = false
Meteor.subscribe("rereun error", {
@subscribe "rereun error",
onStop: @expect (error) =>
@assertEqual(isReady, true, 'received error on rerun')
@assertEqual(error.message, '[triggered error]')
onReady: () =>
@assertTrue isReady, true, 'received error on rerun'
@assertEqual error.message, '[triggered error]'
onReady: =>
isReady = true
})

ClassyTestCase.addTest new ReactivePublishErrorTests

0 comments on commit 3265536

Please sign in to comment.