Skip to main content
1 vote
1 answer
345 views

I have a problem using chai-http for testing, when I use npm test or mocha I get this error Exception during run: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\...\...
osmaldym's user avatar
0 votes
1 answer
191 views

I’m trying to validate a JSON response in Insomnia against a predefined schema using an after-response script. Here’s my script: var statisticsSchema = { "$schema": "http://json-...
mfol's user avatar
  • 31
1 vote
0 answers
183 views

I have written a WhatsApp bot using whatsapp-web.js, and it works fine in production. However, when I try to run tests, they fail, and I suspect the issue lies with my mocks, but I am not entirely ...
Austin's user avatar
  • 434
1 vote
1 answer
511 views

chai latest version 5.1.2 move to ESModule. Is it possible continue use it in CommonJS file? chai is just a dev dependency in my project, used for unit test. I don't want to upgrade my modules to ...
Kerwen's user avatar
  • 562
0 votes
1 answer
50 views

I have written ERC20 token presale smart contract. I have defined token transfer function as follows: function transferTokensToPresale(uint256 presaleSupplyAmount_) public onlyOwner returns (bool) { ...
Alen Schmitt's user avatar
2 votes
1 answer
111 views

I'm writing Cypress tests and running them headless in terminal. The tests are passing even when they should fail. For example writing this code: describe('Website Landing', () => { it.only(...
Victor Ferreira's user avatar
3 votes
0 answers
209 views

I have a node server that was originally written in 2018-19 with require and module.exports syntax. I recently upgraded to Chai 5.1, which meant I needed to convert every file in my project to ESM ...
rg_'s user avatar
  • 453
0 votes
0 answers
45 views

the start of my plugin (function(factory) { if (typeof define === "function" && define.amd) { define(["jquery", "jquery-ui-dist"], factory); } else { ...
Mo1's user avatar
  • 389
-1 votes
1 answer
118 views

I'm having problems with Chai Spies. I have a hard time catching how the syntax works. Here, I am trying the simple example. The myMap function which mimics the array.map method: function myMap(...
Rossi's user avatar
  • 1
1 vote
1 answer
510 views

I'm relatively new with Playwright, and despite PW already have an expect function library, I am trying chai to check if can be useful to my tests and their readability. So I did (since I'm using ...
Don Diego's user avatar
  • 1,558
0 votes
1 answer
198 views

I'd like to use k6chaijs with k6 browser module, but I have observed that messages are printed in wrong order. export default () => { describe('New page verifier', async () => { ...
user2860204's user avatar
-1 votes
1 answer
109 views

Quite new to unit testing. I am writing unit tests for my code using Chai+Mocha and Sinon and I am stuck at a point because I am not able to decide whether I should use a Sinon stub or a fake. I have ...
Your Devmate's user avatar
0 votes
1 answer
261 views

I am currently using npm chai version 5.1.1 which now only supports import and not require. I have used dynamic imports which are working fine. However, when I am using the chai-http middleware with ...
pravin pawar's user avatar
0 votes
0 answers
57 views

I am using Chai with Mocha. I write tests something like this: expect(() => f(a, b)).to.throw('Sriharikota we have a problem.') I want to show the stack trace of the original error when it does ...
Reuben Thomas's user avatar
0 votes
1 answer
807 views

I am trying to run an API test for getting the version using Chai. I have this test in src/tests/version.tests.js. I am using mocha ./src/tests/**/*.tests.js to run it. For some reason I get this ...
GenesysRTA's user avatar

15 30 50 per page
1
2 3 4 5
195