From 646a777ec2901090480ad14cdbb625e208a57b4c Mon Sep 17 00:00:00 2001 From: Scott D'Alessandro Date: Tue, 15 Mar 2016 10:32:47 -0400 Subject: [PATCH] removed-testspec-code Great work! Keep in mind, your "solution" file runs first, this is where you define all the functions needed for your test specs. You don't have to invoke, call, or pass arguments to the functions in your properties.js file, this is what the test spec does for you! The specs will invoke and use the code you defined in properties.js and use inside of each spec. In your specs, you will see code that looks like: ``` var someArray = []; expect(setPropertiesOnArrayObj(someArray)).toEqual(someArray); ``` Inside of the `expect` the function you defined is invoked and passed an argument, then `toEqual` checks the value of `someArray` setPropertiesOnArrayObj is invoked! Great work! When you get a chance, please use the forked version of this repository, it makes grading and adding comments a lot easier for instructors. The process of doing this is: 1. Fork Fullstack Test First from the Fullstack's repository. 2. Clone the forked version that is now on your account to your local machine and use that version. 3. The repo will say it is private but since you forked it from Fullstack's account, we can access it and make comments on it. Great work! --- 01_properties/properties.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/01_properties/properties.js b/01_properties/properties.js index 5623f78..d0af7ac 100644 --- a/01_properties/properties.js +++ b/01_properties/properties.js @@ -1,4 +1,7 @@ -var object; +// The test specs create an object that is passed to the setPropertiesOnObjLiteral function, you do not have to create the object that +// is passed to your functions, the test specs do this work for you. + +// var object; function setPropertiesOnObjLiteral(object) { object.x = 7; @@ -8,7 +11,10 @@ function setPropertiesOnObjLiteral(object) { }; } -setPropertiesOnObjLiteral(object); +// You don't have to invoke the function either, the test specs will read the properties.js file first, then it will take any functions +// and code defined and use it in the test specs. The testspecs invoke all of your functions and checks what values they return (.toEqual). + +// setPropertiesOnObjLiteral(object); function setPropertiesOnArrayObj(arrObject) { arrObject.hello = function() { @@ -21,13 +27,14 @@ function setPropertiesOnArrayObj(arrObject) { } } -var arrObject; +// var arrObject; -setPropertiesOnArrayObj(arrObject); +// setPropertiesOnArrayObj(arrObject); -functionObject = function() { - return "I am a function object, all functions are objects! Function can have their own properties too!"; -} +// This is defined in the test spec. +// var functionObject = function() { +// return "I am a function object, all functions are objects! Function can have their own properties too!"; +// } function setPropertiesOnFunctionObj(func) { func.year = 2015; @@ -39,4 +46,4 @@ function setPropertiesOnFunctionObj(func) { } } -setPropertiesOnFunctionObj(functionObject); +// setPropertiesOnFunctionObj(functionObject);