JEST TypeError: exports.overwriteWith is not a function
salehi186 opened this issue · 9 comments
When load test is called inside the jest this error is happening
TypeError: exports.overwriteWith is not a function
`FAIL tests/stress/status.load.test.ts
● Test suite failed to run
TypeError: exports.overwriteWith is not a function
at Object.<anonymous> (../../node_modules/prototypes/index.js:15:9)
at Object.<anonymous> (../../node_modules/loadtest/lib/loadtest.js:10:1)
`
the fix would be easy but not inside this repo
in your prototypes repo should be change index.js to
`
'use strict';
/**
- Export all prototypes.
- (C) 2013 Alex Fernández.
*/
// requires
require('./lib/string.js');
require('./lib/array.js');
var mathLib = require('./lib/math.js');
var objectLib = require('./lib/object.js');
exports= {...objectLib,...mathLib}
// exports
// exports.overwriteWith(objectLib);
// exports.overwriteWith(mathLib);
`
PRs always welcome, also in prototypes ;)
@alexfernandez I have made a PR for prototypes.
Actually it would be too helpful if u could merge it in your repo.
Hi
I also encountered this problem
@alexfernandez, can you merge @salehi186 solution into prototypes repo?
Thx.
@Piranit and @salehi186 I hesitate to merge his solution because it would only work with Node.js v8 and later, while loadtest is supposed to work with v0.12. I would like to find some other solution if at all possible.
What version of Node.js are you using? For me, overwriteWith()
works even with v12 (running npm test
in the prototypes repo). Do you have some minimal example that I can check out?
I'm also running into this issue. Was anyone able to find a solution that works with node v0.12? @Piranit @salehi186 @alexfernandez
At this point we might as well suppose that new versions of loadtest will only run with modern versions of Node.js. If interest is high enough I will merge the PR on prototypes
. Opinions? Please vote with 👍 or 👎 as a reaction to this comment.
Published as loadtest@4.0.0. Please update and report back!
Closing, please reopen if needed.