Repository navigation
Fix tests - #193
Merged
Merged
Fix tests#193
Conversation
This will allow full support for mocking, dumpCache, and correct line numbers in error messages.
Mocking happens only when config.constants.__MOCK__ is true.
Contributor
There was a problem hiding this comment.
Still unnecessary but whatever 😉
When require("mock-modules").dumpCache() is called, all mock functions
previously created continue to refer to the old dirtyMocks array.
If we replace that array with a new one, those mock functions will never
have their .mockClear() methods called again.
The upstream version of mocks.js pulls a similar global trick, and I never
understood why until now.
No longer injecting __MOCK__ as a global constant (it's just a config property now). Turns out the `grunt jsx:debug` task was never necessary for tests.
benjamn
added a commit
that referenced
this pull request
Jul 15, 2013
This was referenced Jul 17, 2013
bvaughn
pushed a commit
to bvaughn/react
that referenced
this pull request
Aug 13, 2019
Don't reorder a single child
mrizwanashiq
pushed a commit
to mrizwanashiq/react
that referenced
this pull request
Jun 25, 2026
Don't reorder a single child
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #155 and #154 and supersedes #177 and #156.
I wrote a new packaging tool called Populist that does everything we needed Browserify for (entry points, global variables, and of course module loading) but creates
<script>tags for each module so that file names and line numbers will be correct in test output.