feat: codegen script to generate actix web tests

This commit is contained in:
Aravinth Manivannan 2025-01-10 15:49:38 +05:30
parent 753863052a
commit 5352fcccfc
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -0,0 +1,28 @@
#!/bin/bash
help() {
echo "Usage: web_test_generator.sh <domain name> <handler route>"
}
run() {
echo "
#[actix_rt::test]
async fn $1_web_$2_ui_works() {
let routes = RoutesRepository::default();
page_test_runner( &routes.$2).await;
}"
}
if [ -z $1 ]
then
help
elif [ -z $2 ]
then
help
else
run $1 $2 | wl-copy
run $1 $2
fi