Wizcorp / node-pivotal

NodeJS API library for PivotalTracker
44 stars 20 forks source link

Removed double callback issue & fixed tests #16

Closed MRdNk closed 11 years ago

MRdNk commented 11 years ago

This is removed the try, catch and fixes the tests to not error out.

This is the first set of merges, next will be the fixes for getProjects - to all be an array of stories.

MRdNk commented 11 years ago

Thinking about this, some of this code - conflicts with the other changes I'm currently making. However, this might be a good patch release, pre- a minor release for the api result changes.

What do you think?

stelcheck commented 11 years ago

Tried to run the code. On a project without stories, I get:

Calling getStories 519957
callback: { '0': null, '1': {} }
No stories in project! {}

events.js:74
        throw TypeError('Uncaught, unspecified "error" event.');
              ^
TypeError: Uncaught, unspecified "error" event.
    at TypeError (<anonymous>)
    at Parser.EventEmitter.emit (events.js:74:15)
    at Parser.exports.Parser.Parser.parseString (/home/mt/node-pivotal/node_modules/xml2js/lib/xml2js.js:223:21)
    at Parser.parseString (/home/mt/node-pivotal/node_modules/xml2js/lib/xml2js.js:6:61)
    at IncomingMessage.<anonymous> (/home/mt/node-pivotal/index.js:783:20)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:872:14
    at process._tickCallback (node.js:415:13)
MRdNk commented 11 years ago

Closed for cleaner commits.