Skip to content

Commit 3859bb9

Browse files
committed
chore: add an integration test
1 parent 3338408 commit 3859bb9

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!deno.lock
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"workspace": []
3+
}

crates/base/test_cases/pin-package/deno.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import isOdd from "npm:is-odd@^3";
2+
import json from "npm:is-odd@^3/package.json" with { type: "json" };
3+
4+
console.log(isOdd);
5+
6+
Deno.serve(() => new Response(json["version"]));

crates/base/tests/integration_tests.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,6 +4176,27 @@ directory."
41764176
}
41774177
}
41784178

4179+
#[tokio::test]
4180+
#[serial]
4181+
async fn test_pin_package_version_correctly() {
4182+
integration_test!(
4183+
"./test_cases/pin-package",
4184+
NON_SECURE_PORT,
4185+
"",
4186+
None,
4187+
None,
4188+
None,
4189+
(|resp| async {
4190+
let res = resp.unwrap();
4191+
assert!(res.status().as_u16() == 200);
4192+
4193+
let body_bytes = res.bytes().await.unwrap();
4194+
assert_eq!(body_bytes, r#"3.0.0"#);
4195+
}),
4196+
TerminationToken::new()
4197+
);
4198+
}
4199+
41794200
#[derive(Deserialize)]
41804201
struct ErrorResponsePayload {
41814202
msg: String,

0 commit comments

Comments
 (0)