Skip to content

Commit d7935dd

Browse files
committed
chore: add an integration test
1 parent 94858a4 commit d7935dd

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
@@ -4224,6 +4224,27 @@ async fn test_user_worker_with_import_map() {
42244224
}
42254225
}
42264226

4227+
#[tokio::test]
4228+
#[serial]
4229+
async fn test_pin_package_version_correctly() {
4230+
integration_test!(
4231+
"./test_cases/pin-package",
4232+
NON_SECURE_PORT,
4233+
"",
4234+
None,
4235+
None,
4236+
None,
4237+
(|resp| async {
4238+
let res = resp.unwrap();
4239+
assert!(res.status().as_u16() == 200);
4240+
4241+
let body_bytes = res.bytes().await.unwrap();
4242+
assert_eq!(body_bytes, r#"3.0.0"#);
4243+
}),
4244+
TerminationToken::new()
4245+
);
4246+
}
4247+
42274248
#[derive(Deserialize)]
42284249
struct ErrorResponsePayload {
42294250
msg: String,

0 commit comments

Comments
 (0)