Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Basic test setup.

  • Loading branch information...
rasvaan committed Oct 5, 2016
1 parent 86f2192 commit b2bb4bc8d3fa9fc8fb0515b8bb912ad90f3a97bd
Showing with 28 additions and 1 deletion.
  1. +3 −1 package.json
  2. +19 −0 src/middlewares/__tests__/xeno-canto-api-test.js
  3. +6 −0 src/middlewares/xeno-canto-api.js
@@ -5,7 +5,7 @@
"scripts": {
"start-prod": "node ./src",
"dev": "nodemon ./src/index.js",
"test": "return 1"
"test": "mocha $(find ./src -name '*-test.js')"
},
"repository": {
"type": "git",
@@ -23,6 +23,8 @@
"wordpress": "^1.2.1"
},
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.1.0",
"nodemon": "^1.9.2"
}
}
@@ -0,0 +1,19 @@
// npm test,
//https://mochajs.org/
//http://chaijs.com/
var expect = require('chai').expect;
var xenoCantoApi = require('../xeno-canto-api');

describe('xeno-canto-api', function() {
describe('process aggregations', function() {
it('should be true', function() {
expect(xenoCantoApi.processAggregations()).to.be.empty;
});
it('async should be true', function() {
return xenoCantoApi.testAsyncVal()
.then(function(val) {
expect(val).to.equal('bl0')
})
});
});
});
@@ -66,6 +66,12 @@ module.exports = {

return aggregations;
},
testAsyncReject() {
return Promise.reject();
},
testAsyncVal() {
return Promise.resolve('bla');
},
metadataOptions: function() {
const url = platforms.platform("xeno-canto").endpoint_location;

0 comments on commit b2bb4bc

Please sign in to comment.
You can’t perform that action at this time.