drashland / rhum

A test double library
https://drash.land/rhum
MIT License
92 stars 6 forks source link

async hooks for tests #43

Closed ZE0TRON closed 4 years ago

ZE0TRON commented 4 years ago

Description

Guergeiro commented 4 years ago

Hey @ZE0TRON, can you provide some tests that use this feature? Probably just copying and pasting our tests but make them resolve some kind of promise (preferably at least 1s promise).

ebebbington commented 4 years ago

For example, in tests/hooks/*, you could add a new suite:

  Rhum.testSuite("test suite 3", () => {
    Rhum.beforeAll(async () => {
      // do something asynchronous
    });
    Rhum.testCase("Hook can be async", () => {
      // Assert a value was changed by the hook - this test is expected to run after the hook
    });
  });
ZE0TRON commented 4 years ago

@crookse should i add tests for all hooks or is this enough ?