Skip to content

Commit

Permalink
BUG: Explicitly declare project name to pass in to Conf
Browse files Browse the repository at this point in the history
  • Loading branch information
riyadhalnur committed Aug 20, 2019
1 parent 7882cf7 commit 2a0b04e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'use strict';

const axios = require('axios');
const Conf =require('conf');
const Conf = require('conf');

const API_URL = 'https://micro-weather.now.sh';
const config = new Conf();
const schema = require('./schema');
const config = new Conf({
projectName: 'weather-cli',
schema
});

const _toFahrenheit = temp => Math.round((9 / 5) * temp + 32);

Expand Down
15 changes: 15 additions & 0 deletions schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const schema = {
city: {
type: 'string'
},
country: {
type: 'string'
},
scale: {
type: 'string'
}
};

module.exports = schema;
7 changes: 6 additions & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const Conf = require('conf');
const config = new Conf();

const schema = require('../schema');
const config = new Conf({
projectName: 'weather-cli',
schema
});
const weather = require('../index.js');

chai.use(chaiAsPromised);
Expand Down

0 comments on commit 2a0b04e

Please # to comment.