added flag for tests requiring lbc

This commit is contained in:
bill bittner 2017-12-18 15:23:23 -08:00
parent 07d0031f1c
commit 5ade0ec856
4 changed files with 8 additions and 2 deletions

View file

@ -21,6 +21,11 @@ spee.ch is a single-serving site that reads and publishes images and videos to a
* To run hot, use `nodemon` instead of `node` * To run hot, use `nodemon` instead of `node`
* visit [localhost:3000](http://localhost:3000) * visit [localhost:3000](http://localhost:3000)
## Tests
* Spee.ch uses `mocha` with `chai` for testing.
* To run all tests that do not require LBC, run `npm test -- --grep @usesLbc --invert`
* To run all tests, including those that require LBC (like publishing), simply run `npm test`
## API ## API
#### GET #### GET

View file

@ -5,6 +5,7 @@
"main": "speech.js", "main": "speech.js",
"scripts": { "scripts": {
"test": "mocha --recursive", "test": "mocha --recursive",
"test-all": "mocha --recursive",
"start": "node speech.js", "start": "node speech.js",
"lint": "eslint .", "lint": "eslint .",
"fix": "eslint . --fix", "fix": "eslint . --fix",

View file

@ -86,11 +86,11 @@ describe('end-to-end', function () {
const publishUrl = '/api/claim-publish'; const publishUrl = '/api/claim-publish';
const date = new Date(); const date = new Date();
const name = `test-publish-${date.getFullYear()}-${date.getMonth()}-${date.getDate()}-${date.getTime()}`; const name = `test-publish-${date.getFullYear()}-${date.getMonth()}-${date.getDate()}-${date.getTime()}`;
const filePath = './test/mock-files/bird.jpeg'; const filePath = './test/mock-data/bird.jpeg';
const fileName = 'byrd.jpeg'; const fileName = 'byrd.jpeg';
describe(publishUrl, function () { describe(publishUrl, function () {
it(`should receive a status code 200 within ${publishTimeout}ms`, function (done) { it(`should receive a status code 200 within ${publishTimeout}ms @usesLbc`, function (done) {
chai.request(host) chai.request(host)
.post(publishUrl) .post(publishUrl)
.type('form') .type('form')

View file

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB