question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stored snapshots can't be found on CI only

See original GitHub issue

🐛 Bug Report

Snapshots can’t be found on CI even when snapshots are checked in the source control.

  ● Attributes
    expect(value).toMatchSnapshot()
    New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
    This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

To Reproduce

https://travis-ci.org/Prettyhtml/prettyhtml/jobs/436540742

Jest version: 23.6.0

Expected behavior

Tests should work as locally because all my snapshots are checked in the source control.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

8reactions
superhawk610commented, Jun 20, 2019

To further clarify for anyone else that stumbles on this thread, here’s the situation that causes this:

src
 └─ __tests__
   ├─ foo.test.js      // <- you want to run these
   └─ bar.test.js      // <-
 └─ __snapshots__
   ├─ foo.test.js.snap
   └─ bar.test.js.snap
dist
 └─ __tests__
   ├─ foo.test.js      // <- CI is also running these
   └─ bar.test.js      // <- (though they have no snapshots)

To debug this, double-check your jest.config.js and make sure you’ve correctly configured the testPathIgnorePatterns to include /dist/ or something similar.

Hope this helps!

1reaction
StarpTechcommented, Nov 4, 2018

@joaoeudes7 Look at my last comment it was my fault.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to take s3 enabled etcd snapshots on rke1 clusters
This happens when a cluster is created with an rke template with s3 snapshots enabled. Happens only with rke1 clusters
Read more >
Persistent disk snapshots - Compute Engine - Google Cloud
Note: You cannot change the storage location of an existing snapshot. If you need to move a snapshot from one region or multi-regional...
Read more >
Understanding Database snapshots vs Database backups in ...
Database snapshots can only be a supplement for backup/restore, never a substitute. Snapshots are found to be useful for reporting and auditing ...
Read more >
Snapshot Testing - Jest
A typical snapshot test case renders a UI component, takes a snapshot, then compares it to a reference snapshot file stored alongside the...
Read more >
Amazon EBS local snapshots on Outposts
Amazon EBS snapshots are a point-in-time copy of your EBS volumes. By default, snapshots of EBS volumes on an Outpost are stored in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found