it("should support apostrophe'd test names", () => {
snapshot(42);
});
will succeed on the first run, but create a snapshot file like this.
exports['should support apostrophe'd test names 1'] = 42
(note the single-quote within single-quotes that makes the snapshot invalid javascript).
Then any later attempts to run the tests cause a massive :fire:
exports['should support apostrophe'd test names 1'] = 42
evalmachine.<anonymous>:1
exports['should support apostrophe'd test names 1'] = 42
^
SyntaxError: Unexpected identifier
at createScript (vm.js:53:10)
at Object.runInNewContext (vm.js:91:10)
at loadSnaps (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot-core\src\file-system.js:26:8)
at Object.loadSnapshots (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot-core\src\file-system.js:5
4:17)
at storeValue (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot-core\src\index.js:59:24)
at setOrCheckValue (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot-core\src\index.js:114:7)
at snapShotCore (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot-core\src\index.js:138:12)
at setOrCheckValue (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot\src\index.js:137:5)
at snapshot (C:\Users\pcavit\Desktop\snap-shot\node_modules\snap-shot\src\index.js:151:12)
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)
√ should support apostrophe'd test names
1 passing (22ms)
which for some reason is still considered a passing test?
will succeed on the first run, but create a snapshot file like this.
(note the single-quote within single-quotes that makes the snapshot invalid javascript).
Then any later attempts to run the tests cause a massive :fire:
which for some reason is still considered a passing test?