Last modified: 2014-10-20 17:56:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46264, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44264 - Make mobileFrontend an object created with "new"
Make mobileFrontend an object created with "new"
Status: NEW
Product: MobileFrontend
Classification: Unclassified
Hygiene (Other open bugs)
unspecified
All All
: Low normal
: ---
Assigned To: Jon
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-23 01:16 UTC by Juliusz Gonera
Modified: 2014-10-20 17:56 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Juliusz Gonera 2013-01-23 01:16:04 UTC
Currently mobileFrontend is an object which persists state but can't be easily reinitialized. This makes unit testing more difficult (tests are not atomic), e.g.:

Unit test 1
- M.define( 'testModule', ... );
- checks that calling M.define( 'testModule', ... ) again throws an error saying that module exists.

Unit test 2
- M.define( 'testModule', ... ); <--- FAILS here because the previous test already defined 'testModule' and M is not reinitialized
- checks if M.require( 'testModule' ) returns what we just defined

We should be able to do M = new MobileFrontend(); in setup().
Comment 1 Michelle Grover 2013-04-28 17:14:11 UTC
Assigned Mingle Ticket https://mingle.corp.wikimedia.org/projects/mobile/cards/720

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links