meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
497 stars 118 forks source link

(bug?) snapshot load fails when you use backtick (`) in description #192

Open wataru358 opened 3 years ago

wataru358 commented 3 years ago

Thank you for this awesome plugin. I am not sure if this is actually by design or not, or worth fixing but just in case other people are having same issue, reporting it here.

Describe the bug Cypress fails to load snapshot, even tho snapshot is there.

To Reproduce Steps to reproduce the behavior:

  1. setup cypress-plugin-snapshots per Readme
  2. create test like so:
    it("do not use `backtick`, it will break snapshot", ()=>{
    // your test
    });

Expected behavior Snapshot is loaded and pass.

Actual Behavior Snapshot begins like this:

exports[`do not use `backtick`, it will break snapshot #0`] = `...`

backtick breaks syntax, and node cannot read the snapshot.

Desktop (please complete the following information):

Additional context It's easy to fix once you figure it out.