https://bugzilla.wikimedia.org/show_bug.cgi?id=44264

       Web browser: ---
            Bug ID: 44264
           Summary: Make mobileFrontend an object created with "new"
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: MobileFrontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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().

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to