Skip to content

Conversation

@braidn
Copy link

@braidn braidn commented Jan 14, 2015

Setup js testing for angular/js.

Will be used for testing controllers/directives/models

When bundling the project angularjs-rails whines about there being no
source for the .36 version. Bump to fix.
Teaspoon environment file and helper created. To really do testing in
Angular you apparently need the angular-mocks library. Pulled this into
the support section and included it into the spec_helper.
Since the dummy app is used to grok the way the gem modifies
Spree/Rails, let's load it during the test. Redefine RAILS_ROOT and
require to coincide with dummy.
Teaspoon needs a few assets built for precompilation in the dummy app.
Add them to the dummy assets initializer.
When running the Javascript suite of tests, it will be run using
PhantomJS. Allow everyone running these tests to have easy knowledge of
the version of PhantomJS. This file can be used with the PhantomENV
library. Basically rbenv but for PhantomJS
@braidn
Copy link

braidn commented Jan 14, 2015

Currently reads 0 failing tests. I set it up to use Mocha and Chai as test frameworks and assertion libs. However, this is completely modifiable.

@joshnuss
Copy link
Contributor Author

@braidn Looks good!

@braidn
Copy link

braidn commented Mar 20, 2015

Hey all,

I would like to resurrect this. Is this still a want/request? Anyone have some sensible places I should start when writing some tests?

@joshnuss
Copy link
Contributor Author

@braidn this is very needed, have not forgot about it. Was having issues with getting capybara features to pass in the CI, so wanted to resolve that before merging this.

Thinking the best places to start doing JS testing is either the controller or model layer. The capybara tests will handle the e2e tests.

@braidn
Copy link

braidn commented Mar 20, 2015

@joshnuss this shouldn't touch or cause any issue with capybara e2e tests. It should setup a layer that is perfect for model/controller testing. Unless the teaspoon dependencies are causing items to break and I missed that.

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.

3 participants