UNPKG

966 BJavaScriptView Raw
1"use strict";
2let earth = require('../index.js').earth;
3let chai = require('chai');
4
5let assert = chai.assert;
6
7describe('Earth', function() {
8 it('should return json with full args imagery endpoint', function(done) {
9 earth.imagery({lon:100.75,
10 lat:1.5,
11 date:"2015-02-02",
12 cloud_score:true})
13 .then(function(data){
14 assert.containSubset(JSON.parse(data), {id: "LC8_L1T_TOA/LC81270592015038LGN00"});
15 done();
16
17 }).catch(done);
18
19 });
20 it('should return json with full args assets endpoint', function(done) {
21 earth.assets({lon:100.75, lat:1.5, begin:"2014-02-01", end: "2015-02-11"})
22 .then(function(data){
23 assert.containSubset(JSON.parse(data), {results: [ { date: "2014-02-04T03:30:01", id: "LC8_L1T_TOA/LC81270592014035LGN00"}]});
24 done();
25
26 }).catch(done);
27
28 });
29});