Skip to content

Commit 943dfa7

Browse files
committed
Tidy up some test setup
1 parent 29dde81 commit 943dfa7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/android/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ describe('Test Android unpinning', function () {
8484
proxyServer.reset();
8585

8686
let reqCount = 0;
87-
proxyServer.forAnyRequest().thenCallback((req) => {
87+
await proxyServer.forAnyRequest().thenCallback((req) => {
8888
console.log(`Intercepted request ${reqCount++}: ${req.method} ${req.url}`);
8989
return { statusCode: 200, body: 'Mocked response' };
9090
});
9191

9292
seenRequests = [];
9393
tlsFailures = [];
94-
proxyServer.on('request', (req) => seenRequests.push(req));
95-
proxyServer.on('tls-client-error', (event) => tlsFailures.push(event));
94+
await proxyServer.on('request', (req) => seenRequests.push(req));
95+
await proxyServer.on('tls-client-error', (event) => tlsFailures.push(event));
9696
});
9797

9898
async function launchFrida(scripts: string[]) {
@@ -137,10 +137,11 @@ describe('Test Android unpinning', function () {
137137

138138
afterEach(async function (this: Mocha.Context) {
139139
if (this.currentTest?.state === 'failed') {
140-
console.log('Test failed');
141140
if (driver) {
142141
const source = await driver.getPageSource().catch((e) => e.message);
143-
console.log('Current page source:', source);
142+
console.log('Test failed in this state:', source);
143+
} else {
144+
console.log('Test failed but no driver available to log state');
144145
}
145146
}
146147
});

0 commit comments

Comments
 (0)