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.

Jest-like simple interface

See original GitHub issue

Started using chai-jest-snapshot recently with mocha, but I fear my colleagues will not like the additional effort of supplying a filepath & name for each snapshot.

Do you have any plans to allow a default / automatic filepath / name so that assertions can simply be made with:

expect(tree).to.matchSnapshot();

I’d love to help out if I can.

P.s. Additionally an easier way to update all snapshots would be nice, but I’ve not had any thoughts about ways to improve it yet. But if it were possible to do so with mocha -u (or similar, as this is already used for --ui), that’d be awesome.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
suchipicommented, Apr 4, 2017

Hi, @truongsinh, I haven’t forgotten about you, I just had a busy weekend. I’ll try to look at this sometime this weekend

1reaction
JakeSidSmithcommented, Mar 7, 2017

Further thoughts:

You could allow users to define some config for how their snapshots will be output e.g.

chai.use(chaiJestSnapshot({
  // To match jest
  path: '__snapshots__', // relative or root
  suffix: '.snap',
  // Additional options
  prefix: 'snapshot'
}));

Possibly allow outputting versions as Jest does (which could be configured by users):

// Jest Snapshot v1, https://goo.gl/fbAQLP
Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Your First Interface - YouTube
Creating Your First Interface. 2.2K views 5 years ago. Qvera. Qvera. 295 subscribers. Subscribe. 8. I like this. I dislike this.
Read more >
Testing TypeScript interfaces with jest-mock-extended - Medium
A simple example where we mock an TS interface which is a dependency of a class: import { mock } from 'jest-mock-extended';interface Device ......
Read more >
Kav-K/GPT3Discord: A robust, but simple GPT3 ... - GitHub
A robust, but simple GPT3 interface with Discord. Chat just like ChatGPT right inside Discord! Generate beautiful AI art using DALL-E 2!
Read more >
How to add global commands to Jest like describe and it?
If you're using typescript for writing jest test, the first thing you'll need to do is declare your new function somewhere: interface ......
Read more >
Top 10 Java Unit Testing Frameworks for 2021 - LambdaTest
There is only one loophole or con of JBehave just like any other BDD testing ... like HTMLUnit and Selenium with a simple...
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