Skip to content

Enable mocking of required modules during tests #155

@benjamn

Description

@benjamn

The most recurrent source of disagreement between test results within Facebook and those given by grunt test is that Facebook has a more consistent strategy for mocking modules that are not currently under test.

When I implemented the PhantomJS test harness for this open-source repository, for the sake of experiment and because the "right way" would have been "hard," I decided to play with fire: I discarded the assumption of auto-mocking entirely, in preference to simply fixing any tests that failed because of the lack of mocking.

Fortunately, there have not been too many test failures of that sort, partly due to another mitigating factor: we run each test suite in its own <iframe>, so information is somewhat isolated between each test unit.

Nevertheless, I think we can do a much better job of emulating the mocking behavior of the FB codebase. Discussion of plans here: #154 (comment)

cc @zpao @jeffmo @jordwalke @petehunt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions