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

I have a network that undergoes a loop, and for each iteration its edges update their weight. Some of them increase their weight, strengthening the link between the two nodes, and some of them ...
1 vote
1 answer
202 views

all my tests are running with mocha.js and I can debug them easily, except for one specific test file that causes the error Could not load source 'some path here/fileNameToTest.js': Source not found. ...
Tzachi's user avatar
  • 52
2 votes
0 answers
199 views

I am including my non-exported function (let's say A) to the Jest unit tests with the 'rewire' function. When I run the coverage test, the A function is not included to the coverage test. Is there any ...
0 votes
1 answer
301 views

I'm writing tests for a file(some-file.js) that calls functions from another file(url-manipulator.js). I'm getting an error regarding window.location being undefined. You can see in the error below ...
Dustin's user avatar
  • 3
1 vote
0 answers
170 views

I have a class and a function in one file export class MainClass{ .... } export function test_function(){} Previously, I just had the test_function exported and could easily test it using rewire('...
2 votes
0 answers
783 views

I just cloned a react/typescript template repository and did npm install I should say that the node packages installed in this app is really large number and react rewired is installed too, also the ...
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. ...
0 votes
1 answer
131 views

I have a plain JS file that is written with pre ES6 JS code that I want to test using a karma/jasmine test suite. The file is large but I just want to get a super simple example working. // pluginV3....
1 vote
0 answers
446 views

So, I was doing some testing with Rewire with Mocha, and I noticed behavior that seems odd to me. using myModule.__set__() seems to actually set the specified variable in the the specified module (...
4 votes
1 answer
3k views

I'm trying to write unit tests for some private methods in my class using Typescript for my Node.js module. I tried using rewire, but it's unable to access any methods (even public ones). Here is my ...
4 votes
2 answers
3k views

Note: My goal it bring Rewire like functionally to the project. Be it using the Rewire package, babel-plugin-rewire or any other library that satisfies my goal. With that in mind, here is the detail: ...
0 votes
1 answer
1k views

I would like to be able to isolate the side effects that seem to be related when testing two functions that modify the same state variable myVar independently of each other. example.js export function ...
DraQ's user avatar
  • 390
2 votes
0 answers
481 views

Using Rewire for testing.. Rewire is failing to rewire, and I'm wondering why. Here is an example of rewire failing: A file has a few exported functions... export function foo() {} export function bar(...
GN.'s user avatar
  • 10.1k
2 votes
1 answer
552 views

The main.js is like this const p0 = (a, b) => (a+b) const p1 = (a, b) => { return p0(a, b) + 10; } module.exports = { p1 } The test code const rewire = require('rewire'); const myMod = ...
user3552178's user avatar
  • 3,033
0 votes
1 answer
662 views

I'm trying to test a method that contains a reference to a global variable containing some configs taken from a json file. async function methodToTest(var1, var2, var3) { const functionName = '...

15 30 50 per page
1
2

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