Let jasmine tests run locally ( on a Mac)

Finally I get jasmine running locally on my Mac (11.2.1).
What I need to do was:

  • Precomile assets in production: RAILS_ENV=production rails assets:precompile
  • Add this two lines to config/initializers/assets.rb:
    • Rails.application.config.assets.precompile += %w( jasmine-load-all.js )
    • Rails.application.config.assets.precompile += %w( jasmine-jquery.js )
  • Generate a local cert ( for production runs)
    • openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
  • Enable line ā€˜certificate_authoritiesā€™ in diaspora.toml (not diaspora.yml as message shows!)

After these steps I no can run rake jasmine and rake jasmine:ci

Are these steps anywhere documented?
Shouldnā€™t it be documented in WIKI?

All test suites are meant to be run in the test environment, not in the production environment. In test, neither asset precompiling, nor SSL enforcement is on. rake selects the testing environment correctly, but for jasmine, the wiki clearly states

RAILS_ENV=test bin/rake jasmine

Why are you trying to run jasmine in the production env?

You are right, I didnā€™t saw this. IMHO this article is buried to deep inside the WIKI.
I started with jasmine by naively running rake jasmine - which lead into ā€œAssets need to be precompiled in productionā€.
Whats about writing a (shorter) How-To list - and / or add these steps to the contributing.md file?

Well itā€™s linked on the front page, you canā€™t make that more discoverable with the current layoutā€¦ :wink:

The CONTRIBUTING.md already links to the testing workflow wiki page - ā€œWrite tests.ā€ is one of the four steps under ā€œContributing to the codeā€. You also canā€™t make that any more discoverable, if people donā€™t read that file, then theyā€™ll not see anything we do there.

As for condensingā€¦ you canā€™t condense that information down without losing details, so uh, probably not. That being said, weā€™re currently throwing away all the contents and re-writing them for the new project site anyway, so Iā€™ll keep that in mind.

1 Like

Good to know that this will be addressed in a re-write. So Iā€™d like to emphasis thatā€™s a nice concession for (new) developers to find all they need in this file, without diving to links. The most important steps should be prominent in this file.
Diving into links only for the details.