Last modified: 2014-10-20 17:56:22 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().
Assigned Mingle Ticket https://mingle.corp.wikimedia.org/projects/mobile/cards/720