Note that there are some explanatory texts on larger screens.

plurals
  1. POTesting client-side JavaScript using jasmine-node and jquery-jasmine
    primarykey
    data
    text
    <p>I'm trying to write some JavaScript unit tests using <code>jasmine-node</code> and <code>jquery-jasmine</code>, and I'm stuck with a configuration problem. Currently, here is the only "test" I"m trying to run:</p> <pre><code>describe("A suite", function() { it("contains spec with an expectation", function() { loadFixtures('blah.html'); expect(true).toBe(true); }); }); </code></pre> <p>I'm getting the following error when I try to run the test:</p> <pre><code> Failures: 1) A suite contains spec with an expectation Message: ReferenceError: loadFixtures is not defined Stacktrace: ReferenceError: loadFixtures is not defined at [object Object].&lt;anonymous&gt; (/home/chris/Source/www/projects/wash/spec/javascripts/blah.spec.js:6:9) at [object Object].execute (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1001:15) at [object Object].next_ (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1790:31) at [object Object].start (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1743:8) at [object Object].execute (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:2070:14) at [object Object].next_ (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1790:31) at [object Object].start (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1743:8) at [object Object].execute (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:2215:14) at [object Object].next_ (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1790:31) at [object Object].start (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js:1743:8) Finished in 0.006 seconds 1 test, 1 assertion, 1 failure </code></pre> <p>When I comment out the <code>loadFixtures</code> line in the test, it works fine.</p> <p>I assume that <code>jasmine-jquery</code> is not loading properly, but I'm not sure what to do about that. (I have very little experience with <code>nodejs</code> or <code>npm</code>.)</p> <p>If it's of diagnostic value, when I run <code>which jasmine-node</code> (within bash) I get a result, but when I run <code>which jasmine-jquery</code>, I do not. I assume that this is because the former is meant to be executable while the latter is not, but I don't want to make any assumptions. (<code>npm show</code> indicates that both packages are installed, however.)</p> <p>What am I doing wrong?</p> <p>Thanks very much for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload