dev: use fixtures/playground if name is not provided (#804)

This commit is contained in:
Myriad-Dreamin 2024-11-13 23:51:39 +08:00 committed by GitHub
parent 41868aa0f4
commit cadc70ceec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,6 +29,8 @@ use crate::{
type CompileDriver<C> = CompileDriverImpl<C, tinymist_world::LspCompilerFeat>;
pub fn snapshot_testing(name: &str, f: &impl Fn(&mut LocalContext, PathBuf)) {
let name = if name.is_empty() { "playground" } else { name };
let mut settings = insta::Settings::new();
settings.set_prepend_module_to_snapshot(false);
settings.set_snapshot_path(format!("fixtures/{name}/snaps"));