Closed tivac closed 7 years ago
@tivac $ DEBUG=snap-shot npm run test
would tell us more...
Yes, thanks @pygy for suggesting DEBUG
constant. I suspect something bad happens due to Windows file system.
Added debug flag, no real change to the output.
C:\Users\pcavit\Desktop\snap-shot>set DEBUG=snap-shot
C:\Users\pcavit\Desktop\snap-shot>npm test
> snapshot-testing@1.0.0 test C:\Users\pcavit\Desktop\snap-shot
> mocha
snap-shot [] +0ms
1) should test using snapshots
0 passing (8ms)
1 failing
1) should test using snapshots:
Error: Do not have caller function callsite
at snapshot (node_modules\snap-shot\src\index.js:63:11)
at Context.it (test\snap-shot.test.js:6:5)
npm ERR! Test failed. See above for more details.
I guess I'll try to dig in. 😞
It's stack-sites
e.stack
on Windows looks like this
Error: stack-sites
at stackSites (c:\Users\pcavit\Desktop\snap-shot\node_modules\stack-sites\src\index.js:14:13)
at snapshot (c:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot\src\index.js:54:17)
at Context.it (c:\Users\pcavit\Desktop\snap-shot\test\snap-shot.test.js:6:5)
at callFn (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runnable.js:345:21)
at Test.Runnable.run (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runnable.js:337:7)
at Runner.runTest (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:444:10)
at c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:550:12
at next (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:361:14)
at c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:371:7
at next (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:295:14)
at Immediate.<anonymous> (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:339:5)
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
at processImmediate [as _immediateCallback] (timers.js:611:5)
None of those lines contain (/
so they all get filtered out and dropped.
Haha I guess my check was really amateurish - thanks for digging and finding it!
Sent from my iPhone
On Mar 14, 2017, at 12:37, Pat Cavit notifications@github.com wrote:
It's stack-sites
e.stack on Windows looks like this
Error: stack-sites at stackSites (c:\Users\pcavit\Desktop\snap-shot\node_modules\stack-sites\src\index.js:14:13) at snapshot (c:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot\src\index.js:54:17) at Context.it (c:\Users\pcavit\Desktop\snap-shot\test\snap-shot.test.js:6:5) at callFn (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runnable.js:345:21) at Test.Runnable.run (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runnable.js:337:7) at Runner.runTest (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:444:10) at c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:550:12 at next (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:361:14) at c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:371:7 at next (c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:295:14) at Immediate.
(c:\Users\pcavit\Desktop\snap-shot\node_modules\mocha\lib\runner.js:339:5) at runCallback (timers.js:666:20) at tryOnImmediate (timers.js:639:5) at processImmediate [as _immediateCallback] (timers.js:611:5) None of those lines contain (/ so they all get filtered out and dropped. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
@tivac see if newly released version solves this, it has better stack parsing function
That fixed it, thanks for the quick turnaround @bahmutov!
@bahmutov I see that stack-sites
got updated, since snap-shot
doesn't use semver ranges for dependencies it looks like I'll have to manually shuffle around folders in /node_modules
to get this working until a new version is published.
Any ETA on a new version of snap-shot
being published to npm?
Found why it did not publish new version - it tested new code against project 'snap-shot-ava-test' and found that lines like are not handled properly :)
✔ sum › adds 1 + 2 to equal 3
foo
✖ sum › adds 1 + 2 to equal 3 snapshot Error: Could not parse stack line " at Array.map (native)"
invalid number of parts (native) full line at Array.map (native)
✖ sum-async › async concat strings Error: Could not parse stack line " at next (native)"
invalid number of parts (native) full line at next (native)
Opened https://github.com/bahmutov/stack-sites/issues/5 - when that one is fixed, will release.
ok, hope 2.16.1 is the charm!
Trying a really simple test with
snap-shot
and it seems to always be unable to determine the calling function.Using
snap-shot@2.16.0
,mocha@3.2.0
, andnode@7.7.2
on windows.Test File
Output
Am I doing something wrong here?