Skip to content

Commit 6912369

Browse files
authored
fix: improve wait command (#40)
1 parent c3404d7 commit 6912369

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/commands/mockBridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const waitForRequest = async (alias: string): Promise<Rule> => {
9191
await wait(SW_DELAY);
9292
const rule = rules.find((r) => r.alias === alias && r.executed);
9393
if (rule) return Promise.resolve(rule);
94-
throw new Error("Rule not found or not executed");
94+
throw new Error(`Rule ${alias} not found or not executed`);
9595
};
9696

9797
/**

src/tests/commands/mockBridge/waitFor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ describe('waitForRequest', () => {
5757

5858
it('throws if the rule is not found or not executed', async () => {
5959
const alias = 'nonExistentAlias';
60-
await expect(waitForRequest(alias)).rejects.toThrow('Rule not found or not executed');
60+
await expect(waitForRequest(alias)).rejects.toThrow(`Rule ${alias} not found or not executed`);
6161
});
6262
});

0 commit comments

Comments
 (0)