Skip to content

Add Jasmine unit testing framework#7

Merged
localjo merged 13 commits intomasterfrom
add-unit-testing
Jul 14, 2014
Merged

Add Jasmine unit testing framework#7
localjo merged 13 commits intomasterfrom
add-unit-testing

Conversation

@localjo
Copy link
Copy Markdown
Member

@localjo localjo commented Jun 30, 2014

I added and configured the Jasmine unit testing framework which can be used to start writing some unit tests. Before writing any really useful tests, the Chrome API will probably need to be mocked. There's just enough in tests/spec/chrome.helper.js that the Jasmine framework can run without any errors.

@localjo
Copy link
Copy Markdown
Member Author

localjo commented Jun 30, 2014

There is a decent write-up about testing Chrome extensions with Jasmine here: http://blog.robertosoares.me/blog/2012/08/08/testing-chrome-extensions-with-jasmine/

@localjo localjo added this to the v1.0.0 milestone Jul 1, 2014
@localjo localjo self-assigned this Jul 1, 2014
@localjo
Copy link
Copy Markdown
Member Author

localjo commented Jul 1, 2014

@pushred for now I've got the unit testing framework configured and running with Grunt so that we can easily write tests for stuff with minimal friction. I want to merge this branch into the master for now and then open up some new issues to discuss things that need to be tested.

Off the top of my head, one thing that should probably be tested is that we're checking for the right x-powered-by header, since I've already committed that part of the code with the wrong string twice. 🙈

Comment thread tests/spec/basic.spec.js Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to replace this with that header test you mentioned, since you're committing, merging, etc. This way you'd actually be testing your own API rather than the assertion library. That doesn't really count :neckbeard:

@localjo
Copy link
Copy Markdown
Member Author

localjo commented Jul 11, 2014

I added a test to check to make sure getJsonResource() checks the x-powered-by header against the string Solidus (versus another string, like Express).

Something else seems to be preventing Jasmine/PhantomJS from completing tests in general. I think it might have to do with socket.io, but I'm still trying to track down the problem.

@localjo
Copy link
Copy Markdown
Member Author

localjo commented Jul 14, 2014

\o/

localjo added a commit that referenced this pull request Jul 14, 2014
Add Jasmine unit testing framework
@localjo localjo merged commit b617b34 into master Jul 14, 2014
@pushred
Copy link
Copy Markdown
Member

pushred commented Jul 14, 2014

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants