Top "Mocha" questions

Mocha.

How to say "any_instance" "should_receive" any number of times in RSpec

I've got an import controller in rails that imports several csv files with multiple records into my database. I would …

ruby-on-rails testing rspec mocking mocha
JavaScript Standard Style does not recognize Mocha

I have a Mocha test file that looks like this: var expect = require('chai').expect var muting = require('../muting') …

javascript mocha
What is the role of describe() in Mocha?

The documentation at the official Mocha site contains this example: describe('User', function(){ describe('#save()', function(){ it('should …

node.js unit-testing testing mocha
How to set execution order of mocha test cases in multiple files

I have two javascript files which contain mocha test cases. //----------abc.js ------------- describe("abc file", function(){ it("test 1" , function(){ …

javascript node.js tdd mocha
Post request via Chai

I am trying to make a request to my node JS server which accepts post/put call. The parameters I …

node.js mocha chai
How do I test if a function calls a specific method/function?

Is there a way in Mocha to test if a function calls a specific method or external function? I am …

javascript node.js tdd mocha chai
How can I make Mocha load a helper.js file that defines global hooks or utilities?

I have a file named test/helper.js that I use to run Mocha tests on my Node.js apps. …

javascript node.js mocha
How to get Mocha to fail a test

I have the following test: it.only('validation should fail', function(done) { var body = { title: "dffdasfsdfsdafddfsadsa", description: "Postman Description", beginDate: …

javascript node.js mocha
How can I execute async Mocha tests (NodeJS) in order?

This question relates to the Mocha testing framework for NodeJS. The default behaviour seems to be to start all the …

javascript node.js mocha
Running the same mocha test multiple times with different data

Problem I have several tests that do the same thing in mocha. This for me, it's duplication, and is the …

javascript mocha