Clean up unused code/tests

This commit is contained in:
Samer Albahra
2018-07-22 18:43:22 -05:00
parent 14ed3bdc4e
commit 1fa985e941
6 changed files with 3505 additions and 547 deletions

3934
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,16 +11,15 @@
"dotenv": "^2.0.0",
"express": "^4.16.3",
"geo-tz": "^4.0.1",
"grunt": "^1.0.2",
"grunt": "^1.0.3",
"moment-timezone": "^0.5.17",
"mongoose": "^4.13.13",
"suncalc": "^1.8.0",
"xml2js": "^0.4.19"
"suncalc": "^1.8.0"
},
"devDependencies": {
"chai": "^3.0.0",
"grunt-contrib-jshint": "^1.1.0",
"hippie": "^0.5.1",
"hippie": "^0.5.2",
"istanbul": "^0.4.5",
"mocha": "^5.2.0",
"nock": "^9.2.6"

View File

@@ -1,5 +1,4 @@
var http = require( "http" ),
parseXML = require( "xml2js" ).parseString,
Cache = require( "../models/Cache" ),
SunCalc = require( "suncalc" ),
moment = require( "moment-timezone" ),
@@ -11,7 +10,6 @@ var http = require( "http" ),
pws: /^(?:pws|icao|zmw):/,
url: /^https?:\/\/([\w\.-]+)(:\d+)?(\/.*)?$/,
time: /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})([+-])(\d{2})(\d{2})/,
time12: /(\d{1,2}):(\d{2})\s(am|pm)/i,
timezone: /^()()()()()()([+-])(\d{2})(\d{2})/
};

View File

@@ -7,21 +7,6 @@ var hippie = require( "hippie" ),
describe( "Weather API", function() {
describe( "/:method endpoint", function() {
it( "The Weather Channel Source Test", function( done ) {
for ( var test in expected.WSI ) {
if ( expected.WSI.hasOwnProperty( test ) ) {
apiTest( {
method: 1,
loc: test,
expected: expected.WSI[test],
callback: function( reply ) {
done();
}
} );
}
}
} );
it( "Weather Underground Source Test", function( done ) {
for ( var test in expected.WU ) {
if ( expected.WU.hasOwnProperty( test ) ) {
@@ -96,13 +81,6 @@ function setupMocks( location ) {
} )
.get( "/" )
.reply( 200, replies[location].WUyesterday );
nock( "http://api.weather.com" )
.filteringPath( function( path ) {
return "/";
} )
.get( "/" )
.reply( 200, replies[location].WSIcurrent );
}
function extend( target ) {

View File

@@ -1,14 +1,4 @@
{
"WSI": {
"01002": {
"scale": 83,
"rd": -1,
"tz": 32,
"sunrise": 324,
"sunset": 1226,
"eip": 2130706433
}
},
"WU": {
"01002": {
"scale": 61,

View File

@@ -1805,83 +1805,6 @@
"since1jancoolingdegreedaysnormal": ""
}]
}
},
"WSIcurrent": {
"metadata": {
"language": "en-US",
"transaction_id": "1436711713612:406777925",
"version": "1",
"location_id": "01002:4:US",
"units": "e",
"expire_time_gmt": 1436712313,
"status_code": 200
},
"observation": {
"class": "observation",
"expire_time_gmt": 1436712313,
"obs_time": 1436711100,
"obs_time_local": "2015-07-12T10:25:00-0400",
"wdir": 140,
"icon_code": 32,
"icon_extd": 3200,
"sunrise": "2015-07-12T05:24:09-0400",
"sunset": "2015-07-12T20:26:45-0400",
"day_ind": "D",
"uv_index": 6,
"uv_warning": 0,
"wxman": "wx1000",
"obs_qualifier_code": null,
"ptend_code": 0,
"dow": "Sunday",
"wdir_cardinal": "SE",
"uv_desc": "High",
"phrase_12char": "Sunny",
"phrase_22char": "Sunny",
"phrase_32char": "Sunny",
"ptend_desc": "Steady",
"sky_cover": "Clear",
"clds": "CLR",
"obs_qualifier_severity": null,
"vocal_key": "OT78:OX3200",
"imperial": {
"wspd": 2,
"gust": null,
"vis": 10.000,
"mslp": 1017.5,
"altimeter": 30.05,
"temp": 78,
"dewpt": 60,
"rh": 53,
"wc": 78,
"hi": 80,
"temp_change_24hour": 1,
"temp_max_24hour": 85,
"temp_min_24hour": 58,
"pchange": 0.00,
"feels_like": 80,
"snow_1hour": 0.0,
"snow_6hour": 0.0,
"snow_24hour": 0.0,
"snow_mtd": 0.0,
"snow_season": 0.0,
"snow_ytd": 68.4,
"snow_2day": 0.0,
"snow_3day": 0.0,
"snow_7day": 0.0,
"ceiling": null,
"precip_1hour": 0.00,
"precip_6hour": 0.00,
"precip_24hour": 0.00,
"precip_mtd": 1.51,
"precip_ytd": 19.43,
"precip_2day": 0.00,
"precip_3day": 1.07,
"precip_7day": 1.18,
"obs_qualifier_100char": null,
"obs_qualifier_50char": null,
"obs_qualifier_32char": null
}
}
}
}
}