1 | "use strict";
|
2 | let apod = require('../index.js').apod;
|
3 | let chai = require('chai');
|
4 | let assert = chai.assert;
|
5 | let expect = chai.expect;
|
6 | let chaiSubset = require('chai-subset');
|
7 | chai.use(chaiSubset);
|
8 |
|
9 | describe('Apod', function() {
|
10 | it('should return json data with no args passed', function (done) {
|
11 | apod().then(function(data){
|
12 | expect(JSON.parse(data)).to.include.keys("date");
|
13 | done();
|
14 |
|
15 | }).catch(done);
|
16 | });
|
17 |
|
18 | it('should return json data with date passed', function (done) {
|
19 | apod("2017-03-11").then(function(data){
|
20 | assert.containSubset(JSON.parse(data), {date: "2017-03-11"});
|
21 | done();
|
22 |
|
23 | }).catch(done);
|
24 |
|
25 | });
|
26 |
|
27 | it('should return json data with date and concept_tags passed', function (done) {
|
28 | apod("2017-03-11", true).then(function(data){
|
29 | assert.containSubset(JSON.parse(data), {date: "2017-03-11"});
|
30 | done();
|
31 |
|
32 | }).catch(done);
|
33 |
|
34 | });
|
35 | }); |
\ | No newline at end of file |