Skip to content

Commit

Permalink
Add test for the http in r2pipe-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Mar 21, 2024
1 parent eb72e24 commit 8027f45
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
9 changes: 4 additions & 5 deletions typescript/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
all:
tsc -d r2pipe/index.ts
# tsc
tsc test.ts
node test.js
tsc lo.ts
r2 -q -i lo.js /bin/ls
# r2 -q -c '#!pipe node --inspect lo.js' /bin/ls
tsc test-spawn.ts
node test-spawn.js
tsc test-local.ts
r2 -q -i test-local.js /bin/ls

vs vsc:
open -a "Visual Studio Code" .
Expand Down
15 changes: 15 additions & 0 deletions typescript/test-http.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// tsc test-http.ts
// node --insecure-http-parser test-http.js

import * as r2pipe from "./r2pipe/index.js";
// import * as r2pipe from "r2pipe-ts";

async function main() {
console.log("Hello R2Pipe for TypeScript");
const r2 = await r2pipe.open("http://127.0.0.1:9090");
const res = await r2.cmd("?E Hello TypeScript");
console.log(res);
await r2.quit();
}

main().then((x)=>{}).catch(console.error);
File renamed without changes.
File renamed without changes.

0 comments on commit 8027f45

Please sign in to comment.