Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

feat(navigation): upgrade to latest react-navigation v4 #90

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

sibelius
Copy link
Contributor

@sibelius sibelius commented Dec 9, 2019

What:

I'm upgrading react-navigation test examples to use latest v4 version

Why:

This will cause less trouble for newcomers

How:

I've upgrade some packages and added related ones

Checklist:

  • Documentation added to the
    docs site
  • Typescript definitions updated
  • Tests
  • Ready to be merged

I'm having this error:

 /native-testing-library/node_modules/@react-native-community/masked-view/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import MaskedView from './js/MaskedView';
                                                                                             ^^^^^^

    SyntaxError: Cannot use import statement outside a module

I've tried to add @react-native-community/masked-view on transformIgnorePatterns of jest.config.js

but it did not worked

@bcarroll22
Copy link
Collaborator

Awesome thanks! @allcontributors please add @sibelius for code.

@allcontributors
Copy link
Contributor

@bcarroll22

I've put up a pull request to add @sibelius! 🎉

@bcarroll22 bcarroll22 merged commit 065e5f8 into testing-library:master Dec 11, 2019
@bcarroll22
Copy link
Collaborator

Ah I didn't realize this wasn't ready to be merged, sorry going to revert this 😬 my bad.

@bcarroll22
Copy link
Collaborator

🎉 This PR is included in version 5.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sibelius
Copy link
Contributor Author

If you fix the test, feel free to merge it

@mvrdrew
Copy link

mvrdrew commented Feb 9, 2020

Hi, I've run into this issue myself today and thought I'd see if I can track down the problem. I don't know the project well enough to create a PR myself, but hope this helps someone who knows more about it to complete it.

@sibelius, from what I can see you were on the right track by adding @react-native-community to the transformIgnorePatterns, but that jest-preset.js file isn't used by the project's tests, which is why it's failing. It's the project's jest.config.js being used for the local tests, but since they're still using the old transform values it's failing. If they're added there as well it fixes the broken tests.

I've been trying various different ways to make this a bit more future-proof but I'm coming up short. I was hoping to destructure the react-native/jest-preset array into the jest-preset.js and jest.config.js files and add the extra line to each subsequent transformIgnorePatterns field, but no matter what I try I can't get it to recognise more than one entry in the array. I can't tell if this is a jest bug or if I'm doing something wrong.

If anyone else can figure out why this is failing, this PR could be ready to go in no time.

Hope I've been helpful!

Edit: more information after digging into the problem for a little longer and realising what the real problem was!

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

Successfully merging this pull request may close these issues.

3 participants