diff --git a/crates/dt_route/src/lib.rs b/crates/dt_route/src/lib.rs index 5b0db14..415e105 100644 --- a/crates/dt_route/src/lib.rs +++ b/crates/dt_route/src/lib.rs @@ -316,4 +316,154 @@ mod tests { ], ) } + + #[test] + fn unsupported_template_literal_path() { + let module_ast = Input::Code( + r#" + const A = "A"; + const B = "B"; + const C = "C"; + + export default { + 'foo': { + path: `${prefix}/route/path`, + layouts: [A, B], + page: C + }, + }; + "#, + ) + .get_module_ast() + .unwrap(); + let symbol_dependency = collect_symbol_dependency(&module_ast, MOCK_MODULE_PATH).unwrap(); + let mut symbol_to_routes = SymbolToRoutes::new(); + symbol_to_routes + .collect_route_dependency(&module_ast, &symbol_dependency) + .unwrap(); + + assert!(symbol_to_routes + .table + .get(MOCK_MODULE_PATH) + .unwrap() + .is_empty()); + } + + #[test] + fn unsupported_react_router() { + let module_ast = Input::Code( + // Copied from https://github.com/remix-run/react-router/blob/dev/examples/basic/src/App.tsx + r#" + import { Routes, Route, Outlet, Link } from "react-router-dom"; + + export default function App() { + return ( +
+ This example demonstrates some of the core features of React Router
+ including nested <Route>
s,{" "}
+ <Outlet>
s, <Link>
s, and using a
+ "*" route (aka "splat route") to render a "not found" page when someone
+ visits an unrecognized URL.
+
+ Go to the home page +
+