File tree 3 files changed +52
-0
lines changed
test_cases/byonm-typescript
3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ import isodd from "is-odd" ;
2
+ import { createServer } from "node:http" ;
3
+
4
+ class Meow {
5
+ private meow : boolean ;
6
+
7
+ constructor ( odd : number ) {
8
+ this . meow = isodd ( odd ) ;
9
+ }
10
+
11
+ getMeow ( ) {
12
+ return this . meow ;
13
+ }
14
+ }
15
+
16
+ const server = createServer ( ( _ , resp ) => {
17
+ const meow = new Meow ( 33 ) ;
18
+ resp . writeHead ( 200 , {
19
+ "content-type" : "text-plain" ,
20
+ } ) ;
21
+ resp . write ( meow . getMeow ( ) ? "meow" : "meow!!" ) ;
22
+ resp . end ( ) ;
23
+ } ) ;
24
+
25
+ server . listen ( 8080 ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "workspaces" : [],
3
+ "main" : " meow.ts" ,
4
+ "dependencies" : {
5
+ "is-odd" : " ^3.0.1"
6
+ }
7
+ }
Original file line number Diff line number Diff line change @@ -3012,6 +3012,26 @@ async fn test_commonjs_express_websocket() {
3012
3012
test_commonjs_websocket ( String :: from ( "express" ) ) . await ;
3013
3013
}
3014
3014
3015
+ #[ tokio:: test]
3016
+ #[ serial]
3017
+ async fn test_byonm_typescript ( ) {
3018
+ ensure_npm_package_installed ( "./test_cases/byonm-typescript" ) . await ;
3019
+ integration_test ! (
3020
+ "./test_cases/main" ,
3021
+ NON_SECURE_PORT ,
3022
+ "byonm-typescript" ,
3023
+ None ,
3024
+ None ,
3025
+ None ,
3026
+ ( |resp| async {
3027
+ let resp = resp. unwrap( ) ;
3028
+ assert_eq!( resp. status( ) . as_u16( ) , 200 ) ;
3029
+ assert_eq!( resp. text( ) . await . unwrap( ) . as_str( ) , "meow" ) ;
3030
+ } ) ,
3031
+ TerminationToken :: new( )
3032
+ ) ;
3033
+ }
3034
+
3015
3035
#[ tokio:: test]
3016
3036
#[ serial]
3017
3037
async fn test_supabase_ai_gte ( ) {
You can’t perform that action at this time.
0 commit comments