Add more detailed errors for assertConnected

Differential Revision: D39383946

fbshipit-source-id: e11a29c77c5abe7f3fee5e979c596efd31ef4ec2
This commit is contained in:
Andrey Goncharov
2022-09-09 06:30:04 -07:00
committed by Facebook GitHub Bot
parent d2ce30942f
commit a9fe381076
2 changed files with 23 additions and 9 deletions

View File

@@ -166,7 +166,9 @@ test('a plugin cannot send messages after being disconnected', async () => {
await instance.getCurrentState();
} catch (e) {
threw = true; // for some weird reason expect(async () => instance.getCurrentState()).toThrow(...) doesn't work today...
expect(e).toMatchInlineSnapshot(`[Error: Plugin is not connected]`);
expect(e).toMatchInlineSnapshot(
`[Error: SandyPluginInstance.assertConnected -> plugin is not connected]`,
);
}
expect(threw).toBeTruthy();
});