geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

add alias for `asc`(1) and `desc`(-1) #130

Open FvckSh1t opened 10 years ago

mde commented 10 years ago

Could you add a test for this? I'll be happy to merge it then.

FvckSh1t commented 10 years ago

Hey @mde , but I have only mysql and mongodb installed, and I don't know how to test some specific units, or could you tell me which files to add tests?

mde commented 10 years ago

You run the tests by doing jake test. You can pass a string to the task as an arg, and that will be used as a regex for which test files to run. For example, you can run just the tests in the "unit" directory by doing jake test[unit].

You'll definitely want to add an integration test. The tests that are shared by all the adapters are here: https://github.com/mde/model/blob/master/test/integration/adapters/shared.js

Those tests are not run on their own, but are just used as a mixin for each of the various adapter test modules.

So if you add your test in there, and it passes in Mongo and MySQL, you can rely on the Travis CI to ensure that they pass in every other adapter.

Looks like we don't have any sort of "sort" tests in the unit tests for query:

https://github.com/mde/model/blob/master/test/unit/query/query.js

It would be awesome if you can find a way to add a test or two there too.

Hope that helps. :)

FvckSh1t commented 10 years ago

@mde Thanks, it's pretty kind of you to give such a detailed coach for me! I think it takes time for me, such a donkey, to digest xD. I will try these days.

mde commented 10 years ago

No worries. Chime in on this thread if you have any questions as you go. Thanks!