Closed Bug 566051 Opened 15 years ago Closed 15 years ago

test.makeSandboxedLoader() should accept a 'moduleOverrides' option

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: avarma, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

For the purpose of mocking/faking-out module dependencies in unit tests, it should be possible to pass-in a mapping from module names to exports as a 'moduleOverrides' option to text.makeSandboxedLoader().
Blocks: 562234
Attached patch first attempt at a patch (obsolete) — Splinter Review
I'm not super happy with this patch, though we can make it nicer later; we really ought to make it easier in general to provide module overrides, since the cuddlefish module does this itself, and we'd really like to do dependency injection via 'require' for other things.
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
While you're at it, please document makeSandboxedLoader() http://hg.mozilla.org/labs/jetpack-sdk/file/tip/packages/jetpack-core/docs/unit-test.md
Attachment #445466 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product. To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: