Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-4886

Rationalise jqUnit system to be constructor-free, as well as harmonising with GPII implementation on node.js



    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 1.5
    • 1.4
    • Testing Infrastructure
    • None


      Our jqUnit testing system, layered on top of jQuery's QUnit, uses an old-fashioned and misleading system for organising test cases based on the constructor new TestCase(). As well as not agreeing with modern Infusion idioms which are constructor and "this"-free, this sets up misleading expectations in users that tests that are issued will genuinely be scoped to the "TestCase" instance that they are invoked on - in fact QUnit will ignore this scoping and simply apply time-based scoping based on the most recently issued "module" directive.
      We should reorganise jqUnit to remove the confusing idiom as well as name "TestCase", and simply directly pass through QUnit's "module" name and semantics unchanged.

      As part of this work, we will also rationalise the utilities held in "TestUtils.js" to package them as part of jqUnit itself - this will create a core dependence on jqUnit on Fluid.js, but we are no longer intending to advertise or promote the use of our jqUnit outside the Fluid community.

      We will also rationalise the file structure and code loading policy so that the same implementation of jqUnit.js can be used outside the browser environment, for example in the GPII project based on node.js - this will create a separate file jqUnit-browser.js which is to be used within Infusion's brower-based tests themselves.




            jobara Justin Obara
            antranig Antranig Basman
            0 Vote for this issue
            1 Start watching this issue