Top "Stub" questions

A replacement implementation for objects, methods, or functions in order to remove external dependencies.

Stub (...) received unexpected message (...) with (no args)

I try to write a test using RR. What I need is a stub of a model object. describe ApplicationController …

ruby unit-testing testing stub rr
How do I stub an event emitter with Sinon.js

I am trying to stub the following: on('complete', function(data){ }); I only want to call the callback if the …

javascript mocking stub sinon
Stubbing an ES6 class method using Mocha and Sinon in NodeJS

Is there a way to stub an ES6 class method using Mocha/Sinon? I'm trying to do this... sinon.stub(…

javascript node.js mocha.js sinon stub
What are "stubbed child components" in Vue Test Utils?

Vue Test Utils has an API method called shallowMount() that: ...creates a Wrapper that contains the mounted and rendered Vue …

unit-testing vue.js vuejs2 stub vue-test-utils
How do I include test classes and configuration in my war for integration testing using maven?

I currently have a maven web project that I am attempting to write integration tests for. For the structure of …

spring tomcat maven integration-testing stub
Stubbing WebSocket in JavaScript with Jasmine

I try to test if onmessage is a proper function. Here is a test: describe(".init(address, window)", function() { beforeEach(…

javascript testing websocket jasmine stub
Expect the creation of a new object

I need to write an expectation that a new object will be created in a payment system. Code included from …

ruby rspec stub
How to stub require() / expect calls to the "root" function of a module?

Consider the following jasmine spec: describe("something.act()", function() { it("calls some function of my module", function() { var mod = require(…

javascript node.js bdd stub jasmine
Shimming with Microsoft Fakes and a static, generic method

I need to shim a static generic method for a unit test. However, I can't seem to get Fakes to …

unit-testing stub microsoft-fakes shim