Error Expected Object
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 48 Star 928 Fork 179 vlucas/frisby Code Issues 134 Pull requests 14 Projects internet explorer error object expected 0 Pulse Graphs New issue Error: Expected 'undefined' to be type 'object'
Error Object Expected Code 0
for comparison #101 Closed Gaurang033 opened this Issue May 29, 2014 · 5 comments Projects None yet javascript error object expected Labels None yet Milestone No milestone Assignees No one assigned 5 participants Gaurang033 commented May 29, 2014 Hi, I was trying a simple test case, however getting error object expected ie error while running it, the site sends the json response however it seems like frisby is not able to identify it. Following is the code i am using var frisby = require('frisby'); frisby.create('Get host informations') .get('http://freegeoip.net/json/yahoo.com') .expectStatus(200) .expectHeaderContains('content-type', 'application/json') .inspectJSON() .expectJSON('0',{ country_code: 'US', country_name: 'United States', region_code: 'CA', region_name: 'California', city: 'Sunnyvale' } ) .toss(); Owner vlucas commented May 29,
Error Object Expected Flash
2014 The test is failing because you have a 0 in as the path parameter. This tells frisby that you are expecting an array, and want to compare the first value, The JSON response in question just provides a single object, so there is no need for a path at all. var frisby = require('frisby'); frisby.create('Get host informations') .get('http://freegeoip.net/json/yahoo.com') .expectStatus(200) .expectHeaderContains('content-type', 'application/json') .inspectJSON() .expectJSON({ country_code: 'US', country_name: 'United States', region_code: 'CA', region_name: 'California', city: 'Sunnyvale' }) .toss(); vlucas closed this May 29, 2014 Gaurang033 commented May 30, 2014 Thanks, I guess it would be really nice if someone can update the documents on firsby.js website. it doesn't have all the required details. Verkalets commented Jan 15, 2016 Agree with @Gaurang033 @vlucas You made a really cool tool, but if you provide a bit more of documentation, it would awesome. michaelezehi commented Jan 20, 2016 I had the same issue and took off the first parameter and it worked ( .expectJSONTypes('args', { },). This was total fluke as it wasn't documented on the official frisby site. cpa
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about error object expected ie7 Stack Overflow the company Business Learn more about hiring developers or posting ads with internet explorer script error object expected us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Object Expected Error In Internet Explorer 8
a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JS error: object expected up vote 1 down vote favorite I load an https://github.com/vlucas/frisby/issues/101 internal page that I developed in IE and at the bottom it displays some JS error: It says Line 107 character 6. I look at the JScript file and it has this code: function isLessThanStartDate(obj) { var startdate = new Date(document.getElementById('txtSD').value); var enddate = new Date(obj.value); var weekending = new Date(document.getElementById('txtWE').value); if (!(isDate(startdate))) { obj.style.backgroundColor="red"; alert (obj.value + " is not a valid date!"); obj.value=""; return; } if (enddate < http://stackoverflow.com/questions/6033546/js-error-object-expected startdate) { obj.style.backgroundColor="red"; alert ("End date: " + enddate + " cannot be less then start date: " + startdate); obj.value=""; } else if (enddate > weekending) { obj.style.backgroundColor="red"; alert ("End date: " + enddate + " cannot be greater then week ending date: " + weekending); obj.value=""; } else { obj.style.backgroundColor=""; } } Line 107 is the line where it says var weekending = new Date(document.getElementById('txtWE').value); Why is this complaining? I don't see anything wrong with it... javascript share|improve this question edited May 17 '11 at 16:01 Dan Davies Brackett 6,94512045 asked May 17 '11 at 15:48 oJM86o 83462658 4 I don't believe the error report uses the phrase "some JS error". What does it actually say? –Quentin May 17 '11 at 15:49 3 If it's IE, it's not much better than that... –Rudie May 17 '11 at 15:51 @David Dorward - @Rudie is right it doesnt display much else..I tried using firebug but it doesnt give me any info (as I dont know how to use it). It says this: User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322) Timestamp: T
up a Development Environment Run the http://eslint.org/docs/rules/object-shorthand Unit Tests Working with Rules Working with Plugins Shareable Configs Node.js API Maintainer guide Blog Demo ESLint Demo Espree Demo About Open search Search Close search Require Object Literal Shorthand Syntax (object-shorthand) The --fix option on the object expected command line automatically fixes problems reported by this rule. EcmaScript 6 provides a concise form for defining object literal methods and properties. This syntax can make defining complex object literals much cleaner. Here are a few common examples error object expected using the ES5 syntax: // properties var foo = { x: x, y: y, z: z, }; // methods var foo = { a: function() {}, b: function() {} }; Now here are ES6 equivalents: /*eslint-env es6*/ // properties var foo = {x, y, z}; // methods var foo = { a() {}, b()<