mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 13:09:41 +00:00
Update api legacy test readme
This commit is contained in:
parent
73b2208106
commit
27d9e60d0f
1 changed files with 3 additions and 30 deletions
|
|
@ -1,32 +1,5 @@
|
|||
# API Tests
|
||||
# Legacy API Tests
|
||||
|
||||
Our API tests are written in [coffeescript](http://coffeescript.org/) using the [Mocha testing framework](http://mochajs.org/).
|
||||
These tests have been deprecated. Any tests that you see in this folder should be converted to ES2015 and ported to the `/test/api` directory.
|
||||
|
||||
There's a variety of ways to run the tests:
|
||||
|
||||
```bash
|
||||
# Individually
|
||||
mocha test/api/name_of_test.coffee
|
||||
# The entire collection of api tests
|
||||
mocha test/api
|
||||
# As part of the whole test suite
|
||||
npm test
|
||||
```
|
||||
|
||||
### Modules
|
||||
|
||||
Some modules are declared in the [api-helper.coffee](api-helper.coffee) file for use in any of the api tests:
|
||||
|
||||
* `moment` - time manipulation
|
||||
* `async` - run async processes, good for before blocks
|
||||
* `lodash (_)` - many utilities
|
||||
* `shared` - generate uuids
|
||||
* `expect` - making assertions
|
||||
* `User` - look up a User in the db
|
||||
|
||||
### Helper Methods
|
||||
|
||||
There are helper methods declared in the [api-helper.coffee](api-helper.coffee) file. Some useful methods contained there:
|
||||
|
||||
* `registerNewUser(callback, main)` - Theres a global user variable that gets overwritten with the new user whenever you call `registerNewUser` unless you pass false in as the second argument.
|
||||
* `registerManyUsers(number, callback)` - Good for testing things that require many users. The callback function returns new users as and array in the second argument.
|
||||
Once all tests have been ported, this directory will be removed.
|
||||
|
|
|
|||
Loading…
Reference in a new issue