Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
60 views

I am trying to unit test all of my API calls. Every call passes the test, but i still get an error saying: ✘ Timed out while running tests Failed to exit when running test.js. I have tried adding a ...
1 vote
2 answers
91 views

I want to test a Google Cloud Function written in Typescript, and the function calls publishMessage, a member function of the Topic class. How can I make a unit test capture the argument that got ...
4 votes
0 answers
259 views

I am experiencing an error with test suite while trying to stub out a method that queries sql db:below is the code i wrote but i keep getting error: TypeError: Cannot read properties of undefined (...
0 votes
0 answers
55 views

I need to replace the function returns by a module. I'm using CommonJS with nodejs 18. index.js const sinon = require("sinon"); const axios = require("axios"); const fs = require(&...
2 votes
0 answers
610 views

I have the following file to test which is the migration_repository.js import {getDatabaseName} from "./maria_db_connector" export default class MigrationRepository { ...
0 votes
1 answer
139 views

I have the following code: const {compose} = require('./compose'); const complicatedFunction = async function (argA, argB) { const result = await getValue(argA) const value = await getValue2(...
2 votes
1 answer
3k views

I am using mocha and sinon for test the node services, In controller I have getToken npm module for getting the token with name and value as parameters and in spec file I trying to send empty name as ...
0 votes
1 answer
1k views

I am just getting started unit testing nodejs. I have been using mocha, chai and sinon. I hit a snag when I wanted to test a function which is not exported. proxyquire looks good, as does rewire. ...
1 vote
1 answer
687 views

In controller I have imported config file for getting path for userId and secret path location and auth file for getting the userId name and secret value based on that I have redirected to some ...
1 vote
1 answer
4k views

In my controller I have imported the secure util file when I call that util with path as parameter it returns unique Id. but how to call this function in test file using proxyquire and stub. ...
2 votes
1 answer
4k views

I have written a test code to test code that gives credentials from AWS Secret Manager. I used proxyquire and sinon for stubbing and getting this error. Function I want to test exports....
0 votes
1 answer
2k views

I have a class modules/handler.js, which looks like this: const {getCompany} = require('./helper'); module.exports = class Handler { constructor () {...} async init(){ await ...
0 votes
1 answer
456 views

Hello I am new to testing with mocha/chai/sinon and sequelize-test-helpers Trying to use proxyquire to override the require but having issues Getting this following error about the path: Error: ENOENT:...
0 votes
1 answer
267 views

I am facing issue in testing where My logger is in lambda layer thus non-existing for nodeJs import in lambda.js during mocha-chai testing. I tried mock-fs but getting errors Can not find module /opt/...
0 votes
1 answer
2k views

I have a file foo.js var request = require('request'); module.exports.getRequest = function (url, headers) { return new Promise((resolve, reject) => { request( { ...

15 30 50 per page
1
2 3 4 5
...
8

AltStyle によって変換されたページ (->オリジナル) /