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

Update tests to not warn due to moved PropTypes and shallowRenderer #9486

Merged
merged 3 commits into from
Apr 25, 2017

Conversation

flarnie
Copy link
Contributor

@flarnie flarnie commented Apr 21, 2017

This will unblock continued work on the 15.6-dev branch.

We added some warnings in v15.5 for calling React.PropTypes and
calling the shallow renderer from the wrong place. These warnings were
causing test failures, and now they are fixed.

Most of these were for the React.PropTypes change.

@flarnie flarnie added this to the 15.6 milestone Apr 21, 2017
Copy link
Collaborator

@sophiebits sophiebits left a comment

Choose a reason for hiding this comment

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

thanks for working through these!

@flarnie
Copy link
Contributor Author

flarnie commented Apr 21, 2017

OwnerUMDShim.js src/umd/shims/ReactUMDShim.js
/Users/flarnie/Code/wrapper-around-fresh-react-project/react/scripts/prettier/index.js:76
    throw e;
    ^

Error: spawnSync /Users/flarnie/Code/wrapper-around-fresh-react-project/react/node_modules/.bin/prettier ENOENT
    at exports._errnoException (util.js:1018:11)
    at spawnSync (child_process.js:459:20)
    at execFileSync (child_process.js:496:13)
    at exec (/Users/flarnie/Code/wrapper-around-fresh-react-project/react/scripts/prettier/index.js:42:10)
    at Object.keys.forEach.e (/Users/flarnie/Code/wrapper-around-fresh-react-project/react/scripts/prettier/index.js:61:5)
    at Array.forEach (native)
    at Object.<anonymous> (/Users/flarnie/Code/wrapper-around-fresh-react-project/react/scripts/prettier/index.js:45:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "prettier"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! react-build@15.5.4 prettier: `node ./scripts/prettier/index.js write`
npm ERR! Exit status 1

This happens when I run npm run prettier, and similar error when I run yarn prettier. This is the last issue blocking a couple of changes I'd like to push. Still looking for the cause.

@sophiebits
Copy link
Collaborator

I'm guessing

Error: spawnSync /Users/flarnie/Code/wrapper-around-fresh-react-project/react/node_modules/.bin/prettier ENOENT

means "while executing spawnSync", a ENOENT ("Error NO ENTry", the code for "No such file or directory") error was hit when looking for /Users/flarnie/Code/wrapper-around-fresh-react-project/react/node_modules/.bin/prettier. If you indeed don't have a prettier binary at that path, you probably just need to run yarn (or npm install).

@flarnie
Copy link
Contributor Author

flarnie commented Apr 21, 2017

Thanks - that makes sense. That file is indeed missing, and does not appear after yarn or npm install. But I can look into what might cause it to be missing. This is helpful.

@bvaughn
Copy link
Contributor

bvaughn commented Apr 22, 2017

Prettier wasn't used in 15. Was added recently.

@sophiebits
Copy link
Collaborator

image

Genius, Brian! Thanks.

@flarnie
Copy link
Contributor Author

flarnie commented Apr 22, 2017

I'm pushing the prettier diff separately - will update this again in a min. Thanks everyone for helping. :)

@flarnie
Copy link
Contributor Author

flarnie commented Apr 22, 2017

FYI here is the plan;

  1. land Run 'prettier' on the v15.6 branch #9487
  2. Rebase this on top of Run 'prettier' on the v15.6 branch #9487 and it should pass CI
  3. Rebase Deduplicate "unknown prop" warning to ease pain of version updates #9488 on top of this, and then fix any remaining test failures there so it passes CI.

We added some warnings in v15.5 for calling `React.PropTypes` and
calling the shallow renderer from the wrong place. These warnings were
causing test failures, and now they are fixed.

Most of these were for the `React.PropTypes` change.
@gaearon
Copy link
Collaborator

gaearon commented Apr 22, 2017

@flarnie Thanks for getting 15 branch back into shape 👍

**what is the change?:**
Updated 'PropTypes' and 'shallow renderer' syntax in a couple more
places to get tests passing.

**why make this change?:**
In order to verify any changes to the 15.6 and 15.* branches in general
we should have tests passing.

**test plan:**
`npm run test`

**issue:**
facebook#9410
@flarnie flarnie merged commit 009c9f7 into facebook:15.6-dev Apr 25, 2017
flarnie added a commit to flarnie/react that referenced this pull request Jun 7, 2017
…acebook#9486)

* Update tests to not warn due to moved PropTypes and shallowRenderer

We added some warnings in v15.5 for calling `React.PropTypes` and
calling the shallow renderer from the wrong place. These warnings were
causing test failures, and now they are fixed.

Most of these were for the `React.PropTypes` change.

* tweak from running prettier

* Final tweaks to get tests passing

**what is the change?:**
Updated 'PropTypes' and 'shallow renderer' syntax in a couple more
places to get tests passing.

**why make this change?:**
In order to verify any changes to the 15.6 and 15.* branches in general
we should have tests passing.

**test plan:**
`npm run test`

**issue:**
facebook#9410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants