4

I'm trying to get started with Vows and Vows-BDD. Unfortunately, the callbacks are tripping me up.

In the very simple example below, how does one fix this error?

** Inside the first context
** Creating Person with name Nick

✗ Errored » callback not fired
      in Create a Person via JavaScript: When a person has a name,
      in Creating a Person
      in undefined✗ Errored » 1 errored  1 dropped
vows_bdd  = require "vows-bdd"
assert    = require "assert"


class Person
  constructor: (@name) ->
    console.log "** Creating Person with name #{@name}"

  greeting: ->
    "Hello, #{@name}"


vows_bdd
  .Feature("Creating a Person")
    .scenario("Create a Person via JavaScript")

    .when "a person has a name", ->
      console.log "** Inside the first context"
      new Person "Nick"

    .then "the person can be greeted", (person) ->
      console.log "person is a #{typeof person} = [#{person}]"
      assert.equal person.greeting(), "Hello, Nick"

    .complete()
    .finish(module)
nickh
  • 4,721
  • 2
  • 29
  • 31

1 Answers1

2

I know this post is old, but as this is the first result when someone searches for this error, I am posting my answer.

I found this post helpful, when dealing with error. http://birkett.no/blog/2013/05/01/vows-errored-callback-not-fired/.

In my code error was due to an exception occurring in one of the topics. Vows does not print actual error, because of that its difficult to understand exact problem.

RohanJ
  • 261
  • 3
  • 12
  • Unfortunately the link seems to be dead, but still +1 for answering an old post :) – Thomas Vervest Jan 25 '15 at 20:50
  • @RohanJ, since the link no longer works, can you post the solution that it explained? – nickh Feb 23 '15 at 15:15
  • @nickh sorry, it was a long time ago and I haven't worked on Vows since, so I don't remember exact solution. But I think one of the Topics was throwing up exception because of which this error occurs. I should have documented it more clearly, sorry for that. – RohanJ Feb 24 '15 at 09:50