-
Notifications
You must be signed in to change notification settings - Fork 6
Jasmine Testing
Here are some helpful resources to get us starting with testing. Jasmine has many good resources that are easy to use and the syntax is very similar to rspec so it should be a smooth transition from Rspec to Jasmine. Here some helpful links:
-
- A great video to get familiar with jasmine installation, running tests, and writing your own with the examples that Jasmine comes with
-
- This is a chrome extension that uses jasmine testing. We can use their tests as guides for our tests, specifically how they test aspects of their objects using spies. Rebecca's test notes:
-
pinpoint-items-from-dom-extractor tests
-
PinPoint.ItemsFromDomExtractor isDefined
-
test that in getTime the document is getting time by class name
-
test that var timeDivArray = ELEMENT GETS DIV ‘ytp-time-current’
-
test that var time = string value of time div i.e. (“0:21”)
-
test that getElements function is being passed a className
-
test that getTime returns time
-
test = if url is a “valid” url that we have a classname for, does the code run
-
else, does nothing happen, or does extension break because of className undefined error?
-
pinpoint-assign-class-name tests
-
PinPoint.AssignClassName is being passed a url
-
assigns this.url to url
-
assigns className to empty string
-
if statement tests if document’s url contains string “youtube” (maybe test for string type instead of specific string”)
-
if no (-1), do nothing
-
if it does, then assign the class name to matching variable