Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated library to use a more robust implementation #50

Draft
wants to merge 62 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5f9cc7f
cleaning the stage
noazark Aug 12, 2016
8b3306d
setting up the project
noazark Aug 13, 2016
eaedf10
getting test stuite to work
noazark Aug 13, 2016
d19682d
roughing out OWM getCurrent and getForecast
noazark Aug 13, 2016
d7aac54
adding support for owm v2.5 appid
noazark Aug 14, 2016
f4c5e1f
parsing json response into object
noazark Aug 14, 2016
db4744a
testing temperature conversions
noazark Aug 14, 2016
53e2631
exporting client and helpers in the main file
noazark Aug 14, 2016
ab299fe
adding high and low
noazark Aug 14, 2016
d79fb63
adding lat, lon and latlon
noazark Aug 14, 2016
eb343ad
adding startsAt and endsAt
noazark Aug 15, 2016
35d1d35
adding temperature
noazark Aug 15, 2016
1d26a91
updating temeperature functions according to new information
noazark Sep 3, 2016
97fab1d
Updated formatting for spacing
Aug 25, 2020
059331a
Additional formatting changes
Aug 25, 2020
923e213
Fixed formatting of files
Aug 25, 2020
bef44d2
Updated dependencies to the latest version
Aug 25, 2020
04d5ff9
Added travis.yml file back
codewithtyler Aug 29, 2020
b621675
Minor update to travis.yml
codewithtyler Aug 29, 2020
14a82a3
Testing updates to travis.yml
codewithtyler Aug 30, 2020
bf12025
Adding in a blank jobs to travis.ytml
codewithtyler Aug 30, 2020
cfcbc7e
Minor update for travis.yml
codewithtyler Aug 30, 2020
d39c17a
Removed circle.yml file
codewithtyler Aug 30, 2020
8d835d6
Formatted file
codewithtyler Aug 30, 2020
617af03
Moved files behind a src folder
codewithtyler Aug 30, 2020
8c0f498
Updatd eslint setttings
codewithtyler Aug 30, 2020
bb05512
Migrated unit tests from Mocha to Jest
codewithtyler Aug 30, 2020
ce47f9b
Removed karma and gulpfile
codewithtyler Aug 30, 2020
e686905
Moved babel configuration to package.json
codewithtyler Aug 30, 2020
657184a
Cleaned up eslint config file
codewithtyler Aug 30, 2020
9b2106c
Updated README with info for running unit tests
codewithtyler Aug 30, 2020
67e17bd
Added examples for getCurrent and getForecast
codewithtyler Sep 6, 2020
e2c764d
Update README.md
codewithtyler Sep 6, 2020
2fcb22a
Update README.md
codewithtyler Sep 6, 2020
a267ed1
Update README.md
codewithtyler Sep 6, 2020
b7e4be9
Merge branch 'master' into merge-master-into-next
codewithtyler Sep 7, 2020
4b71421
Updated helper test file from where I moved the helper.js file into a…
codewithtyler Sep 7, 2020
6a09b35
Merged master into branch
codewithtyler Sep 7, 2020
d6ba6f4
Merge remote-tracking branch 'origin/master' into next
codewithtyler Sep 7, 2020
abd018a
Merged master into branch and resolved conflicts
codewithtyler Sep 7, 2020
f0a9e93
Merge branch 'master' into next
codewithtyler Sep 7, 2020
e867d17
Merge branch 'master' into next
codewithtyler Sep 7, 2020
abc6bd8
Merge branch 'master' into next
codewithtyler Sep 7, 2020
08fb946
Merged master into branch and resolved conflicts
codewithtyler Sep 7, 2020
503530e
Added webpack-cli dependency
Sep 16, 2020
8dfc6b3
Added webpack-node-externals dependency
Sep 16, 2020
c2ef91e
Added webpack dependency to the project
Sep 16, 2020
635a3d0
Added webpack config file
Sep 16, 2020
43b99d5
Added webpack-dev-server dependency
Sep 16, 2020
bae6fd7
Added unminified-webpack-plugin dependency
Sep 16, 2020
f937162
Fixed formatting for helpers.js and fixed webmap config to have minif…
Sep 16, 2020
5540d91
Fixed Node dist/ files to only have minified version
Sep 16, 2020
119d16b
Added missing bundle script
Sep 16, 2020
47eb0eb
Merged master into branch and resolved conflicts
Sep 17, 2020
d022d3b
Fixed issue from merge
Sep 17, 2020
c50b599
Cleaned up README and added missing install syntax
codewithtyler Sep 17, 2020
518af24
Merge branch 'master' into next
Sep 17, 2020
8ab10d6
Merged master into branch and resolved conflicts
codewithtyler Oct 18, 2020
cd06bec
merged master branch and resolved conflicts
codewithtyler Oct 19, 2020
365ae83
Minor update to licensed workflow
codewithtyler Oct 19, 2020
6ac3257
Add support to be able to manually run the Licensed GitHub action
codewithtyler Oct 19, 2020
e152c98
Merge branch 'master' into next
codewithtyler Oct 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding temperature
noazark committed Aug 15, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 35d1d35aabf74d8c66b6b6a8c2938324c9b1cb90
8 changes: 8 additions & 0 deletions clients/owm.js
Original file line number Diff line number Diff line change
@@ -82,6 +82,14 @@ export function startsAt(resource) {
}
}

export function temperature(resource) {
if (!resource.hasOwnProperty('list')) {
return resource['main']['temp'];
} else {
throw new Error('Cannot use temperature() on a forecast, use high() or low()');
}
}

export const utils = {
jsonp(uri) {
return new Promise(function (resolve, reject) {
12 changes: 10 additions & 2 deletions test/clients/test-owm.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import Client, {
lon,
low,
startsAt,
temperature,
utils,
} from '../../clients/owm';
import {response as currentResponse} from './fixtures/get-current';
@@ -144,7 +145,14 @@ describe('OpenWeatherMap#getForecast', function() {
});

describe('temperature', function () {
it('gets the current temperature');
it('throws an error if the resource does not have a temperature');
it('gets the current temperature', function () {
assert.equal(temperature(currentResponseJSON), 304.06);
});

it('throws an error if the resource does not have a temperature', function () {
assert.throws(() => {
temperature(forecastResponseJSON);
});
});
});
});