Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write proper mocha testsuite for NodeJS #2

Open
4 tasks
radare opened this issue Oct 7, 2016 · 0 comments
Open
4 tasks

Write proper mocha testsuite for NodeJS #2

radare opened this issue Oct 7, 2016 · 0 comments
Labels

Comments

@radare
Copy link
Collaborator

radare commented Oct 7, 2016

And ensure the following tests work as expected

There are some code constructions that can result in failed attempts, when the code looks good.

  • openSync() with 1 parameter
var r2pipe = require ('r2pipe');
r2pipe.openSync(function(r2) {
   console.log(r2.cmd('?e hello world'));
});
// TypeError: First argument must be file descriptor
  • openSync() with no parameters
var r2pipe = require ('r2pipe');
var r2 = r2pipe.openSync();
console.log(r2.cmd('?e hello world'));
// TypeError: First argument must be file descriptor
  • open() with 1 parameter
var r2pipe = require ('r2pipe');
r2pipe.open(function(r2) {
   r2.cmd('?e hello world', console.log);
});
// TypeError: First argument must be file descriptor
  • open() with no parameters
var r2pipe = require ('r2pipe');
var r2 = r2pipe.open(); // XXX if no parameters we should connect in sync but continue async
r2.cmd('?e hello world', console.log);
// TypeError: First argument must be file descriptor
@radare radare changed the title Write proper mocha testsuite for nodejs Write proper mocha testsuite for NodeJS Oct 7, 2016
@radare radare added the nodejs label Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant