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.