UNPKG

1 kBJavaScriptView Raw
1"use strict";
2let apod = require('../index.js').apod;
3let chai = require('chai');
4let assert = chai.assert;
5let expect = chai.expect;
6let chaiSubset = require('chai-subset');
7chai.use(chaiSubset);
8
9describe('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