mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Sorry about the thrash in advance! This removes the top level `forget` directory which adds unnecessary nesting to our repo Hopefully everything still works
20 lines
667 B
Rust
20 lines
667 B
Rust
use std::env;
|
|
|
|
use forget_estree::SourceType;
|
|
use forget_hermes_parser::parse;
|
|
use insta::{assert_snapshot, glob};
|
|
|
|
#[test]
|
|
fn fixtures() {
|
|
glob!("fixtures/**.js", |path| {
|
|
println!("fixture {}", path.to_str().unwrap());
|
|
let input = std::fs::read_to_string(path).unwrap();
|
|
let mut ast = parse(&input, path.to_str().unwrap()).unwrap();
|
|
// TODO: hack to prevent changing lots of fixtures all at once
|
|
ast.source_type = SourceType::Script;
|
|
let output = serde_json::to_string_pretty(&ast).unwrap();
|
|
let output = output.trim();
|
|
assert_snapshot!(format!("Input:\n{input}\n\nOutput:\n{output}"));
|
|
});
|
|
}
|