Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: configurable default timeout and interval #18

Merged
merged 2 commits into from
May 16, 2019

Conversation

mmkal
Copy link
Contributor

@mmkal mmkal commented Apr 5, 2019

Hey - love the library! This is a very small PR to allow setting the default timeout and interval globally.

Was going to make an issue but I thought this was simple enough that a PR would be about as easy. Obviously up to you if you want this to go in - it's possible to workaround by wrapping this library's export, but I found myself doing that in a lot of projects, so I wondered if you'd be open to supporting it out-of-the box.

Side note - I noticed there's a file src/index.d.ts, but I'm not sure what this does, since the declaration files are generated by npm run build (which outputs lib/index.d.ts, matching what's in package.json). I left it, but it could probably be safely deleted, along with the other *.d.ts files under src.

@@ -49,4 +54,4 @@ const waitForExpect = function waitForExpect(
});
};

export default waitForExpect;
export default Object.assign(waitForExpect, { defaults });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attached defaults to the exported function rather than as a separate export so that it gets passed along for free when it's re-exported in react-testing-library or similar

@lgandecki lgandecki merged commit 7bf926a into TheBrainFamily:master May 16, 2019
@lgandecki
Copy link
Member

Looks good, thank you! And sorry for the lag - I didn't notice this PR somehow.

@lgandecki
Copy link
Member

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants