Karma can not recognize 'require' statement in JSFileSpec.js file. Running karma.conf.js: (function() { describe("DummyEmitter creation", function(){ return it("creation", function(){ var DummyEmitte...
I set up grunt to run node.js jasmine tests. For some reason, with this config, the results always show double the tests. Here is my config: I'm using jasmine-node which plugs into grunt. /spec/some-spec.js: var myModule = require('../src...
I expect this to say "1 test", but it says "0 tests". Any idea why? This is on OS X. $ jasmine-node --verbose my.spec.js undefined Finished in 0.001 seconds 0 tests, 0 assertions, 0 failures, 0 skipped $ cat my.spec.js describe(...
I'm testing the controller logic behind API endpoints in my node server with jasmine-node. Here is what this controller logic typically looks like: var getSummary = function(req, res) { var playerId = req.params.playerId; db.players.getAcco...
I have a Node.js application that has a main-process.js and a child-process.js. The main-process.js looks like this: var childProcess = require('child_process'); var job = childProcess.spawn('node', ["child-process.js"], {...
After much hacking, I've managed to get a simple Jasmine test running via Node. However, there is some weird stuff I do not understand... The jasmine files export functions that appear to need a reference to themselves passed back in to work (th...
I have the following test code that is being ran by jasmine-node in a file called bob_test.spec.js require('./bob'); describe("Bob", function() { var bob = new Bob(); it("stating something", function() { var result...
I can run my specs with either jasmine-node or just jasmine. They both run my specs. So, what value does jasmine-node add? The readme says: This node.js module makes the wonderful Pivotal Lab's jasmine spec framework available in node.js. h...
const Client = require('./src/http/client'); module.exports.handler = () => { const client = new Client(); const locationId = client.getLocationId(123); }; How can I test this module asserting that the client.getLocationId has b...
My application uses a service that returns a promise that is typically dependant on a whole bunch of other promises. I've refactored this into seperate named functions to make testing (and readability) easier. So in this case I just want to test...
©2020 All rights reserved.