Skip to content

Enable mocking of required modules during tests #155

Closed

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

Activity

  1. ghost assigned on Jul 3, 2013
  2. added a commit that references this issue on Aug 13, 2019
  3. added a commit that references this issue on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions