Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Jul 15, 2024
1 parent 54b5814 commit 8b8cffb
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/__tests__/misc.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { expectError, health, noRoute, testTimeout, version } from './testUtils';
import { expectError, health, noRoute, routeHoma, shouldRouteHoma, testTimeout, version } from './testUtils';

describe.concurrent('/miscellaneous', () => {
describe('when no route for the request', () => {
Expand Down Expand Up @@ -42,4 +42,27 @@ describe.concurrent('/miscellaneous', () => {
// expect(res.data.isHealthy).to.be.true;
});
});

describe.only('/multiple simaltaneous shouldRoute', () => {
it('works', async () => {
const routeParams = {
destAddr: '0x75E480dB528101a381Ce68544611C169Ad7EB342',
chain: 'acala',
};

const routePending = routeHoma(routeParams);

const pendings = [] as any[];
for (let i = 0; i < 10; i++) {
pendings.push(shouldRouteHoma(routeParams));
}

const res = await Promise.all(pendings);

const routeRes = await routePending;
console.log(routeRes)

console.log(res);
});
});
});

0 comments on commit 8b8cffb

Please sign in to comment.