diff --git a/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_abs_path.snap b/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_abs_path.snap new file mode 100644 index 000000000..e230f0601 --- /dev/null +++ b/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_abs_path.snap @@ -0,0 +1,22 @@ +--- +source: crates/symbolicator-js/tests/integration/sourcemap.rs +assertion_line: 380 +expression: response +--- +stacktraces: + - frames: + - filename: test.js + lineno: 1 + colno: 1 + data: + symbolicated: false +raw_stacktraces: + - frames: + - filename: test.js + lineno: 1 + colno: 1 + data: + symbolicated: false +errors: + - abs_path: "" + type: invalid_abs_path diff --git a/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_lineno.snap b/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_lineno.snap new file mode 100644 index 000000000..f825f988e --- /dev/null +++ b/crates/symbolicator-js/tests/integration/snapshots/integration__sourcemap__invalid_lineno.snap @@ -0,0 +1,22 @@ +--- +source: crates/symbolicator-js/tests/integration/sourcemap.rs +assertion_line: 397 +expression: response +--- +stacktraces: + - frames: + - filename: test.js + abs_path: http//example.com/test.min.js + data: + symbolicated: false +raw_stacktraces: + - frames: + - filename: test.js + abs_path: http//example.com/test.min.js + data: + symbolicated: false +errors: + - abs_path: http//example.com/test.min.js + type: invalid_location + line: 0 + col: ~ diff --git a/crates/symbolicator-js/tests/integration/sourcemap.rs b/crates/symbolicator-js/tests/integration/sourcemap.rs index 980567014..c99e4f37e 100644 --- a/crates/symbolicator-js/tests/integration/sourcemap.rs +++ b/crates/symbolicator-js/tests/integration/sourcemap.rs @@ -363,6 +363,40 @@ async fn test_malformed_abs_path() { assert_snapshot!(response); } +#[tokio::test] +async fn test_invalid_abs_path() { + let (symbolication, _cache_dir) = setup_service(|_| ()); + let (_srv, source) = sourcemap_server("", |_url, _query| json!([])); + + let frames = r#"[{ + "filename": "test.js", + "lineno": 1, + "colno": 1 + }]"#; + + let request = make_js_request(source, frames, "[]", String::from("release"), None); + let response = symbolication.symbolicate_js(request).await; + + assert_snapshot!(response); +} + + +#[tokio::test] +async fn test_invalid_lineno() { + let (symbolication, _cache_dir) = setup_service(|_| ()); + let (_srv, source) = sourcemap_server("", |_url, _query| json!([])); + + let frames = r#"[{ + "abs_path": "http//example.com/test.min.js", + "filename": "test.js" + }]"#; + + let request = make_js_request(source, frames, "[]", String::from("release"), None); + let response = symbolication.symbolicate_js(request).await; + + assert_snapshot!(response); +} + #[tokio::test] async fn test_fetch_error() { let (symbolication, _cache_dir) = setup_service(|_| ());