Skip to content

createEvent is not being exported #373

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

Closed
alexreardon opened this issue May 17, 2019 · 9 comments
Closed

createEvent is not being exported #373

alexreardon opened this issue May 17, 2019 · 9 comments
Labels

Comments

@alexreardon
Copy link

alexreardon commented May 17, 2019

  • react-testing-library version: 7.0.0
  • react version: 16.8.6

Relevant code or config:

import { createEvent } from "react-testing-library";
it("should have the createEvent export", () => {
  // this fails as createEvent is undefined
  expect(createEvent).toBeTruthy();
});

https://codesandbox.io/s/reacttestinglibrary-createevent-gr9ms (click on the tests tab)

Problem description:

createEvent is not being exported

@alexreardon
Copy link
Author

I would have expected this line to export it:

https://github.com/testing-library/dom-testing-library/blob/master/src/index.js#L12

@alexkrolick
Copy link
Collaborator

Did you update the dom testing dependency with yarn upgrade react-testing-library?

@bcarroll22
Copy link
Contributor

bcarroll22 commented May 17, 2019

Edit: nvm RTL uses ^ not ~ for the DTL dependency.

Ah, we’ll have to bump the version of DTL used and minor bump this library also. The line you referenced should cover it then since this re-exports everything. Wanna make a PR here as well?

@alexreardon
Copy link
Author

The example I posted is a fresh install from npm

@tommarien
Copy link

Any update on this ?

@bcarroll22
Copy link
Contributor

I can’t reproduce this on a fresh install of RTL. Maybe try deleting package-lock or yarn.lock and node_modules and try a fresh install? The lockfile should say DTL is version 4.1.0 after an install of RTL ^7.0.0.

@tommarien
Copy link

tommarien commented May 19, 2019 via email

@kentcdodds
Copy link
Member

🎉 This issue has been resolved in version 7.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tommarien
Copy link

@kentcdodds Thanks ;)

lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants