Skip to content

Instantly share code, notes, and snippets.

@crutchcorn
Created October 19, 2021 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crutchcorn/6d6128f8e54aaa357fe6c4d80314db15 to your computer and use it in GitHub Desktop.
Save crutchcorn/6d6128f8e54aaa357fe6c4d80314db15 to your computer and use it in GitHub Desktop.
test("Should fail", async (t) => {
const { cleanup, getByText, fireEvent } = await render([""], {
cwd: resolve(__dirname, "../example"),
});
let outputStr;
outputStr = await waitFor(() => getByText("Please choose a generator"));
t.regex(outputStr, /Please choose a generator/);
cleanup();
fireEvent.up();
fireEvent.down();
fireEvent.enter();
outputStr = await waitFor(() => getByText("this is a test"));
t.regex(outputStr, /this is a test/);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment