I use Cypress v10 with typescript. I'd like to add chai-subset plugin. I've added npm package already.
How should I configure Cypress to see the plugin? Will it be then also available for code completion in Visual Studio Code ?
I use Cypress v10 with typescript. I'd like to add chai-subset plugin. I've added npm package already.
How should I configure Cypress to see the plugin? Will it be then also available for code completion in Visual Studio Code ?
The steps given on the npm page are as follows, BUT for Cypress you should omit the first line require('chai') because Cypress has added chai globally and modified it to allow the .should() command to use it.
Add it to the /support/e2e.js file.
// var chai = require('chai'); // NOT THIS LINE
var chaiSubset = require('chai-subset');
chai.use(chaiSubset);
Usage:
cy.get(...)
.should('containSubset', {
a: 'b',
e: {
baz: {
qux: 'quux'
}
}
})