I am trying to migrate a suite of tests from jstestdriver to Evergreen.
Initially trying with one test and running vanilla Jasmine everything
works fine.
When switching to Evergreen however, I cannot get the tests to work
unless I explicitly require dependencies in every Javascript file. So
first I have to require the file under test in the test. In that file
then, I have to require jQuery and everything else it depends on.
Is this expected behavior or am I doing something wrong? I have tried
to change 'public_dir' setting, but with no change.
Cheers /Marcus
--
Marcus Ahnve
http://marcus.ahnve.net
phone: +46 8 56 22 33 94
twitter: mahnve
/Jonas
When I run my examples, the first error I get is that '$' is not
defined, so I obviously need to require jQuery. Trying different
permutations of
require('public/javascripts/jquery-1.4.2.min.js'); in spec_helper.js
with relative paths etcetera produces no different result.
/Marcus
On Mon, Nov 8, 2010 at 22:51, Jonas Nicklas <jonas....@gmail.com> wrote:
> I'd put whatever dependencies are shared in the spec_helper, Evergreen
> will automatically load a file called spec_helper.js or
> spec_helper.coffee in your spec_dir (which is spec/javascripts by
> default). I haven't really felt a performance hit from requiring
> everything in the spec helper, so I've been doing that for now, seems
> like the easiest solution
>
require('/javascripts/jquery-1.4.2.min.js');
/Jonas
/Marcus