From 5ade0ec85622a6c4160f75600268d18a97bcaf04 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 18 Dec 2017 15:23:23 -0800 Subject: [PATCH] added flag for tests requiring lbc --- README.md | 5 +++++ package.json | 1 + test/end-to-end/end-to-end.tests.js | 4 ++-- test/{mock-files => mock-data}/bird.jpeg | Bin 4 files changed, 8 insertions(+), 2 deletions(-) rename test/{mock-files => mock-data}/bird.jpeg (100%) diff --git a/README.md b/README.md index 5669b79c..14b3f048 100644 --- a/README.md +++ b/README.md @@ -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` * 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 #### GET diff --git a/package.json b/package.json index 27c23f39..3a326898 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "speech.js", "scripts": { "test": "mocha --recursive", + "test-all": "mocha --recursive", "start": "node speech.js", "lint": "eslint .", "fix": "eslint . --fix", diff --git a/test/end-to-end/end-to-end.tests.js b/test/end-to-end/end-to-end.tests.js index 5a016d10..d26d5853 100644 --- a/test/end-to-end/end-to-end.tests.js +++ b/test/end-to-end/end-to-end.tests.js @@ -86,11 +86,11 @@ describe('end-to-end', function () { const publishUrl = '/api/claim-publish'; const date = new Date(); 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'; 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) .post(publishUrl) .type('form') diff --git a/test/mock-files/bird.jpeg b/test/mock-data/bird.jpeg similarity index 100% rename from test/mock-files/bird.jpeg rename to test/mock-data/bird.jpeg