Skip to content

Conversation

@dentarg
Copy link
Contributor

@dentarg dentarg commented Feb 18, 2016

Test the parser in the same fashion as twingly/twingly-search-api-ruby#49

package.json Outdated
"url": "git://github.com/twingly/twingly-search-api-node.git"
},
"dependencies": {
"chai-datetime": "^1.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't these be dev dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed they should, I used --save when I should have used --save-dev, will fix, thanks

@walro
Copy link
Contributor

walro commented Feb 18, 2016

LGTM

it('creation', function(done){
var data = fs.readFileSync('./test/fixtures/valid_result.xml', {encoding: 'utf8'});
(new Parser()).parse(data, function(error, result){
expect(result).to.be.instanceof(Result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this is needed here, the point is not to check the return value of the parser but to assert that we find certain properties on the Result type (this is a test for Result).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense, thanks.

> Don't think this is needed here, the point is not to check the return
> value of the parser but to assert that we find certain properties on
> the Result type (this is a test for Result).
@walro
Copy link
Contributor

walro commented Feb 18, 2016

LGTM again :D

@dentarg
Copy link
Contributor Author

dentarg commented Feb 18, 2016

😄

dentarg added a commit that referenced this pull request Feb 18, 2016
@dentarg dentarg merged commit a88afa4 into master Feb 18, 2016
@dentarg dentarg deleted the parser-tests branch February 18, 2016 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants