mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-22 05:35:10 +00:00
Add ServeSession test for project with folder
This commit is contained in:
@@ -197,6 +197,7 @@ mod serve_session {
|
||||
use std::{path::PathBuf, time::Duration};
|
||||
|
||||
use insta::assert_yaml_snapshot;
|
||||
use maplit::hashmap;
|
||||
use rojo_insta_ext::RedactionMap;
|
||||
use tokio::{runtime::Runtime, timer::Timeout};
|
||||
|
||||
@@ -217,6 +218,33 @@ mod serve_session {
|
||||
assert_yaml_snapshot!(view_tree(&session.tree(), &mut rm));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn project_with_folder() {
|
||||
let mut imfs = Imfs::new(NoopFetcher);
|
||||
|
||||
imfs.debug_load_snapshot(
|
||||
"/foo",
|
||||
ImfsSnapshot::dir(hashmap! {
|
||||
"default.project.json" => ImfsSnapshot::file(r#"
|
||||
{
|
||||
"name": "HelloWorld",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
}
|
||||
"#),
|
||||
"src" => ImfsSnapshot::dir(hashmap! {
|
||||
"hello.txt" => ImfsSnapshot::file("Hello, world!"),
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
let session = ServeSession::new(imfs, "/foo", None);
|
||||
|
||||
let mut rm = RedactionMap::new();
|
||||
assert_yaml_snapshot!(view_tree(&session.tree(), &mut rm));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn change_txt_file() {
|
||||
let (state, fetcher) = TestFetcher::new();
|
||||
|
||||
Reference in New Issue
Block a user