Skip to content

Commit

Permalink
fix rhai tests following rhai stabilisation PR (#1365)
Browse files Browse the repository at this point in the history
The tests weren't updated correctly during the rhai promotion from
experimentation. Fixing them now.
  • Loading branch information
garypen committed Jul 15, 2022
1 parent d06c0c3 commit 67b637b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion examples/add-timestamp-header/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ mod tests {
let mock_service = mock.build();

let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/add_timestamp_header.rhai",
"scripts": "src",
"main": "add_timestamp_header.rhai",
}))
.expect("json must be valid");

Expand Down
3 changes: 2 additions & 1 deletion examples/cookies-to-headers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ mod tests {
let mock_service = mock.build();

let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/cookies_to_headers.rhai",
"scripts": "src",
"main": "cookies_to_headers.rhai",
}))
.expect("json must be valid");

Expand Down
3 changes: 2 additions & 1 deletion examples/op-name-to-header/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ mod tests {
let mock_service = mock.build();

let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/op_name_to_header.rhai",
"scripts": "src",
"main": "op_name_to_header.rhai",
}))
.expect("json must be valid");

Expand Down
3 changes: 2 additions & 1 deletion examples/rhai-data-response-mutate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod tests {
async fn test_subgraph_mutates_data() {
// Define a configuration to use with our plugin
let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/rhai_data_response_mutate.rhai",
"scripts": "src",
"main": "rhai_data_response_mutate.rhai",
}))
.expect("valid conf supplied");

Expand Down
3 changes: 2 additions & 1 deletion examples/rhai-error-response-mutate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod tests {
async fn test_subgraph_mutates_error() {
// Define a configuration to use with our plugin
let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/rhai_error_response_mutate.rhai",
"scripts": "src",
"main": "rhai_error_response_mutate.rhai",
}))
.expect("valid conf supplied");

Expand Down
3 changes: 2 additions & 1 deletion examples/rhai-logging/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ mod tests {
let mock_service = mock.build();

let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/rhai_logging.rhai",
"scripts": "src",
"main": "rhai_logging.rhai",
}))
.expect("json must be valid");

Expand Down
3 changes: 2 additions & 1 deletion examples/rhai-subgraph-request-log/router.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rhai:
main: src/rhai_subgraph_request_log.rhai
scripts: src
main: rhai_subgraph_request_log.rhai
3 changes: 2 additions & 1 deletion examples/rhai-subgraph-request-log/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod tests {
async fn test_subgraph_logs_data() {
// Define a configuration to use with our plugin
let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/rhai_subgraph_request_log.rhai",
"scripts": "src",
"main": "rhai_subgraph_request_log.rhai",
}))
.expect("valid conf supplied");

Expand Down
3 changes: 2 additions & 1 deletion examples/rhai-surrogate-cache-key/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod tests {
async fn test_surrogate_cache_key_created() {
// Define a configuration to use with our plugin
let conf: Conf = serde_json::from_value(serde_json::json!({
"filename": "src/rhai_surrogate_cache_key.rhai",
"scripts": "src",
"main": "rhai_surrogate_cache_key.rhai",
}))
.expect("valid conf supplied");

Expand Down

0 comments on commit 67b637b

Please sign in to comment.