-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Create test suite #677
Create test suite #677
Conversation
|
||
stderrMock.expects('error').never() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides this not actually working anymore (because node emits a warning
event rather than error
), it caused problems when calling the test multiple times: sinon complained console
was already wrapped.
// TODO to make this pass: | ||
// - Have abstract-leveldown use level-errors | ||
// - Perform type checks in same order (e.g. check key before callback) | ||
// - Add db.isClosed(), isOpen() to abstract-leveldown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doable, I think 😃
options = xtend(options, { | ||
keyAsBuffer: false, | ||
valueAsBuffer: false | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests implicitly relied on the default utf8 encoding, for the db to return strings. When the db isn't wrapped with encoding-down
, *asBuffer: false
achieves the same.
Travis error:
That's new.. |
Closes #273. Doesn't fully achieve what that ticket describes (being able to call the test suite externally would require moving devDependencies to dependencies, or moving the whole thing to its own module), but there's no use case for that anymore. So, this PR is more about being able to reuse the test suite internally. This allows us to test feature parity between
levelup
andabstract-leveldown
(Level/community#58).