Questions tagged [sinon-chai]

Sinon-Chai offers a collection of unique assertions designed specifically for integrating the Sinon.JS spy, stub, and mocking framework with the Chai assertion library. By combining the strengths of both Chai and Sinon.JS, users are able to leverage the powerful tools provided by each for comprehensive testing support.

Is there a way to simulate AWS Service Comprehend using Sinon and aws-sdk-mock?

As a newcomer to Typescript mocking, I am trying to figure out how to properly mock AWS.Comprehend in my unit tests. Below is the code snippet where I am utilizing the AWS Service Comprehend. const comprehend = new AWS.Comprehend(); export const handler ...

Unit Testing in Vue.JS: The original function remains active even after using sinon.stub()

While unit testing my components (which are coded using TypeScript along with vue-class-component), I am utilizing Sinon to stub API calls. However, even after adding the stub to the test, the original method is still being invoked instead of returning the ...

Encountering Invalid Chai attribute: 'calledWith'

I am currently in the process of implementing unit tests for my express application. However, I encountered an error when running the test: import * as timestamp from './timestamp' import chai, { expect } from 'chai' import sinonChai f ...

Vue.nextTick incorrect detection

scenario: const Constructor = Vue.extend(MyComponent); function createComponent() { vm = new Constructor({ props, }).$mount(); return vm; } Query: In my testing process, I notice vm.$nextTick().then(() => { expect(result).to.eq ...