geoshell
Version:
A CLI to fetch real-time geo-data from your terminal
39 lines (35 loc) • 1.23 kB
JavaScript
const assert = require('assert');
const { country, weather, holidays, neighbors } = require('../lib');
describe('GeoShell', () => {
describe('Country', () => {
it('should return country information', async () => {
const result = await country('Japan');
assert.strictEqual(result.name, 'Japan');
assert.ok(result.capital);
assert.ok(result.population > 0);
});
});
describe('Weather', () => {
it('should return weather information', async () => {
const result = await weather('Tokyo');
assert.strictEqual(result.location, 'Tokyo');
assert.ok('temperature' in result);
assert.ok('condition' in result);
});
});
describe('Holidays', () => {
it('should return holiday information', async () => {
const result = await holidays('US');
assert.ok(Array.isArray(result));
assert.ok(result.length > 0);
assert.ok('name' in result[0]);
assert.ok('date' in result[0]);
});
});
describe('Neighbors', () => {
it('should return neighboring countries', async () => {
const result = await neighbors('Germany');
assert.ok(Array.isArray(result));
});
});
});