Pregunta

I have been working with node and using vows to write tests.

var vows = require('vows');
var assert = require('assert');

var boardData = require('../lib/data/BoardData.js');

vows.describe('Loading provinces and Boundries for').addBatch({
  'version': {
    '2008E5-1':{
      topic: function () { boardData.createBoard("2008E5",this.callback); },
      'exists': function (err,provs,bounds) { assert.ok(true); }
    }/*,
    '2008E5-2': {
      topic: function () { boardData.createBoard("2008E5",this.callback); },
      'exists': function (err,provs,bounds) { assert.ok(true); }
    }*/
  }
}).export(module);

When I Run this code I get the expected results. When I uncomment the commented section notice that two completed successfully but one can discover that is the second one twice by placing a console.log("foo"); in the proper location.

·· ✓ OK » 2 honored (0.067s)
·
✗ Errored » callback not fired
  in version 2008E5-1
  in Loading provinces and Boundries for
  in undefined

This must be that I am missing something or lack the understanding of something, but I cannot figure it out. Can anyone help me? Thanks in advance!

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top