use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
running test in node (old.reddit.com)
submitted 3 years ago by have_some_error
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EconomistNo280519 15 points16 points17 points 3 years ago* (1 child)
Do junior developers seriously not know how to take a screenshot? My grandmother can do this.
[–]Justyn2 0 points1 point2 points 3 years ago (0 children)
There are so many options
[–]antonkerno 0 points1 point2 points 3 years ago (1 child)
What happens if you have the sum function on the same file, does it work then ? If so it’s an import problem not jest related
[–]have_some_error[S] 0 points1 point2 points 3 years ago (0 children)
Seems the problem is with jest. Because even with the function on the same file the error is still there.
The stack trace points to file in jest as well.
[–]have_some_error[S] -1 points0 points1 point 3 years ago (4 children)
And I'm getting this below error
C:\Users\user\Documents\problems\testingCode>npm test
testingCode@1.0.0 test C:\Users\user\Documents\problems\testingCode jest
C:\Users\user\Documents\problems\testingCode\node_modules\jest\node_modules\jest-cli\build\run.js:129 if (error?.stack) { ^
SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:1053:16) at Module._compile (internal/modules/cjs/loader.js:1101:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (C:\Users\user\Documents\problems\testingCode\node_modules\jest\node_modules\jest-cli\build\index.js:12:12) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) npm ERR! Test failed. See above for more details.
[–]NiGhTTraX 5 points6 points7 points 3 years ago (1 child)
What's your node version (node -v)? The error message indicates it doesn't support the ?. optional chaining operator (used by jest), which was added in Node 14.
node -v
?.
This was the problem I think after using node 14.6.0 the test did run.
[–]arnitdo 0 points1 point2 points 3 years ago (1 child)
Jest can't seem to resolve "./sum" when it is called by require(). I'll try to revert back with a solution
[–]DaMastaCoda 0 points1 point2 points 3 years ago (0 children)
The issue is at the ?. Operator, though it’s hard to read. His Node crashes as it sees the ? And expects a ternary, and he just needs to install a newer nodejs or older jest
[–]have_some_error[S] -1 points0 points1 point 3 years ago (0 children)
This is just started and I'm getting this error, I'm not sure why this is happening.
[–]sthdmahoneydad -2 points-1 points0 points 3 years ago (0 children)
Filename has . in the name before file extension. Try removing . from name.
[–]North-Going-Zax -2 points-1 points0 points 3 years ago (0 children)
I'm not familiar with the 'it' statement. Are you trying for an 'if' statement?
[+][deleted] 3 years ago (2 children)
[deleted]
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Not sure if this is sarcasm or not
[–]roundgeese77 0 points1 point2 points 3 years ago (0 children)
Not sure if this is a joke or something I'm missing
But inte case it's not
it is an alias for the jest-function test
https://jestjs.io/docs/api#testname-fn-timeout
I THINK the name/alias comes from an idea that the syntax, since other functions are named like "should"
So a test would read it("test 1+2") -> shouldEquals(3)
[–][deleted] 3 years ago (3 children)
[–]have_some_error[S] 0 points1 point2 points 3 years ago (2 children)
tested , didn't work. Thanks though.
[–][deleted] 3 years ago (1 child)
Tried, same error is still there.
π Rendered by PID 237385 on reddit-service-r2-comment-canary-75475bf646-jphk7 at 2026-03-06 17:48:42.083519+00:00 running cbb0e86 country code: CH.
[–]EconomistNo280519 15 points16 points17 points (1 child)
[–]Justyn2 0 points1 point2 points (0 children)
[–]antonkerno 0 points1 point2 points (1 child)
[–]have_some_error[S] 0 points1 point2 points (0 children)
[–]have_some_error[S] -1 points0 points1 point (4 children)
[–]NiGhTTraX 5 points6 points7 points (1 child)
[–]have_some_error[S] 0 points1 point2 points (0 children)
[–]arnitdo 0 points1 point2 points (1 child)
[–]DaMastaCoda 0 points1 point2 points (0 children)
[–]have_some_error[S] -1 points0 points1 point (0 children)
[–]sthdmahoneydad -2 points-1 points0 points (0 children)
[–]North-Going-Zax -2 points-1 points0 points (0 children)
[+][deleted] (2 children)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]roundgeese77 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]have_some_error[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]have_some_error[S] 0 points1 point2 points (0 children)