Skip to content

Commit

Permalink
WIP: Remove various maybe-unnecessary test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed May 16, 2024
1 parent 3e51ee3 commit e86b7a8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions test/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,7 @@ describe("Frida-JS", () => {
});

for (let i = 0; i < 100; i++) {
it(`can inject into a target node process (${i})`, async function () {
this.timeout(5000);
delay(10);
const startTime = Date.now();

it(`can inject into a target node process (${i})`, async () => {
// Start a Node subprocess to inject into:
const childNodeProc = ChildProc.spawn(
process.execPath,
Expand Down Expand Up @@ -216,22 +212,15 @@ describe("Frida-JS", () => {
childNodeProc.on('error', reject);
});

console.log(`Process started in ${Date.now() - startTime}ms`);
await delay(100);

// Inject into it:
fridaClient = await connect();
await fridaClient.injectIntoNodeJSProcess(
childNodeProc.pid!,
'console.log("Hello from injected script!"); process.exit(0);'
);

console.log(`Injected completed after ${Date.now() - startTime}ms`);

const { exitCode, output } = await outputPromise;

console.log(`Process exited after ${Date.now() - startTime}ms`);

expect(exitCode).to.equal(0);
expect(output).to.equal('Hello from injected script!\n');
});
Expand Down

0 comments on commit e86b7a8

Please sign in to comment.