Comments (4)
Thinking about this more we could do something like this:
use insta;
let mut settings = insta::Settings::new();
settings.set_force_ordering(true);
insta::with_settings(&settings, || {
insta::assert_ron_snapshots_matches!(...)
});
from insta.
IIUC, could you use the preserve_order
so the output is consistent? https://github.com/serde-rs/json/blob/master/Cargo.toml#L50
from insta.
I'm not a huge fan of the preserve_order
feature at all because that means turning it on or off will affect how stuff works. I wonder if it would be better to go via our internal Content
abstraction and enforce ordering there in some situations.
from insta.
This works now on master:
Lines 4 to 23 in 5d8f8c4
from insta.
Related Issues (20)
- Consider ways to avoid conflicts with Jest snapshots for external tools (like GitHub Linguist)
- feature: return structured errors instead of panicking and printing HOT 7
- Support test execution with Miri HOT 1
- NotADirectory error when a `.config` file exists
- Feature request: custom headers in a snap file HOT 4
- Instability and Unpredictable Snapshot Order in Tests using Insta and SQLx HOT 7
- FR: `cargo insta test` should accept the `--test` option more than once
- `assert_toml_snapshot` produces invalid TOML when the `toml` library would generate an error. HOT 5
- Insta 2.0 ideas? HOT 6
- Newline proposal HOT 2
- `cargo insta test --all-targets` exits with an error when there are doctests
- cargo metadata JSON output parsed as yaml HOT 5
- `yaml-rust` dependency is flagged by `cargo-deny` as no longer maintained HOT 1
- Find a replacement for rust-yaml HOT 9
- The extension does nothing if the crate is not in workspace root HOT 2
- cargo insta test error: unexpected argument '--color' found HOT 3
- Using insta for schema generation and updates HOT 6
- require_full_match mode always fails with matching snapshots HOT 2
- `INSTA_UPDATE=always cargo test` with an incorrect inline snapshot passes HOT 1
- Support inline updates without cargo-insta
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from insta.