Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tcannonfodder
Last active December 10, 2015 18:08
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcannonfodder/4472668 to your computer and use it in GitHub Desktop.
Save tcannonfodder/4472668 to your computer and use it in GitHub Desktop.
This is a bare-minimum testem configuration file that will allow you to use testem with a rails project. You save it in the root directory of the project (at the same level as the Gemfile), and then you can navigate to the project and run testem. How it works: What this configuration does is precompile the assets before the tests are run using t…
{
"framework": "jasmine",
"src_files": [
"app/assets/javascripts/*.js",
"spec/scripts/*.js"
],
"serve_files": [
"public/assets/*.js",
"spec/scripts/*.js"
],
"before_tests": "rake assets:precompile RAILS_ENV=development",
"after_tests": "rm -rf public/assets/"
}
@afurmanov
Copy link

If precompiling your assets takes too much time you may use symbolic links: http://afurmanov.com/2013/08/20/testing-javascript-in-isolation-from-rails/

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