Herdr UI
Herdr의 TUI가 뛰어나며, 창을 통해 추가되는 기능
Rust용 스냅샷 테스트 라이브러리
A snapshot testing library for rust
개발 도구Rust · TypeScriptGitHub @mitsuhiko직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
설치형 프로젝트는 배포 도메인 없이도 확인할 수 있습니다. 개인 저장소는 GitHub 로그인으로, 조직 저장소는 위의 저장소 확인 파일로 직접 확인해 주세요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Snapshots tests (also sometimes called approval tests) are tests that
assert values against a reference value (the snapshot). This is similar
to how assert_eq! lets you compare a value against a reference value but
unlike simple string assertions, snapshot tests let you test against complex
values and come with comprehensive tools to review changes.
Snapshot tests are particularly useful if your reference values are very large or change often.
#[test]
fn test_hello_world() {
insta::assert_debug_snapshot!(vec![1, 2, 3]);
}
Curious? There is a screencast that shows the entire workflow: watch the insta introduction screencast. Or if you're not into videos, read the 5 minute introduction.
Insta also supports inline snapshots which are stored right in your source file instead of separate files. This is accomplished by the companion cargo-insta tool.
For looking at .snap files there is a vscode extension
which can syntax highlight snapshot files, review snapshots and more. It can be installed from the
marketplace: view on marketplace.
Insta uses similar for all its diffing
operations. You can use it independently of insta. You can use the
similar-asserts crate to get
inline diffs for the standard assert_eq! macro to achieve insta like diffs
for regular comparisons:
use similar_asserts::assert_eq;
fn main() {
let reference = vec![1, 2, 3, 4];
assert_eq!(reference, (0..4).collect::<Vec<_>>());
}
If you like the project and find it useful you can become a sponsor.