Merge branch 'develop' into flag_messages_in_api
This commit is contained in:
@@ -19,15 +19,15 @@ $ npm install -g gulp
|
||||
To run the api tests, make sure the mongo db is up and running and then type this on the command line:
|
||||
|
||||
```bash
|
||||
$ gulp test:api
|
||||
$ gulp test:api-v2
|
||||
```
|
||||
|
||||
It may take a little while to get going, since it requires the web server to start up before the tests can run.
|
||||
|
||||
You can also run a watch command for the api tests. This will allow the tests to re-run automatically when you make changes in the `/test/api/` or `/website/src/` directories.
|
||||
You can also run a watch command for the api tests. This will allow the tests to re-run automatically when you make changes in the `/test/api/v2/`.
|
||||
|
||||
```bash
|
||||
$ gulp test:api:watch
|
||||
$ gulp test:api-v2:watch
|
||||
```
|
||||
|
||||
One caveat. If you have a severe syntax error in your files, the tests may fail to run, but they won't alert you that they are not running. If you ever find your test hanging for a while, run this to get the stackstrace. Once you've fixed the problem, you can resume running the watch comand.
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
resetHabiticaDB,
|
||||
requester,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /groups', () => {
|
||||
const NUMBER_OF_PUBLIC_GUILDS = 3;
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
import {
|
||||
find,
|
||||
each
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
import { each, find } from 'lodash';
|
||||
|
||||
describe('POST /groups/:id/join', () => {
|
||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
import { find } from 'lodash';
|
||||
|
||||
describe('POST /groups/:id/leave', () => {
|
||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id/removeMember', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('DELETE /groups/:id/chat', () => {
|
||||
let api, group, message, user;
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /groups/:id/chat', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id/chat', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id/chat/:id/flag', () => {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id/chat/:id/like', () => {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
import {v4 as generateRandomUserName} from 'uuid';
|
||||
|
||||
describe('POST /register', () => {
|
||||
@@ -1,4 +1,4 @@
|
||||
import {requester} from '../../helpers/api.helper';
|
||||
import {requester} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('Status', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('DELETE /user', () => {
|
||||
let api, user;
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user', () => {
|
||||
let user;
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tags', () => {
|
||||
let api, user;
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tags/id', () => {
|
||||
let api, user;
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../helpers/api.helper';
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
import { each } from 'lodash';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
import { each } from 'lodash';
|
||||
|
||||
describe('GET /user/anonymized', () => {
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
import { each } from 'lodash';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /user/pushDevice', () => {
|
||||
let api;
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('DELETE /user/tasks/:id', () => {
|
||||
let api, user, task;
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tasks/', () => {
|
||||
let api, user;
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tasks/:id', () => {
|
||||
let api, user, task;
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /user/tasks', () => {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../helpers/api.helper';
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('PUT /user/tasks/:id', () => {
|
||||
let api, user, task;
|
||||
Reference in New Issue
Block a user