Comprehensive state management #120

Closed
johnbender opened this Issue Jul 4, 2011 · 3 comments

Comments

2 participants
@johnbender

State management

One of the primary issues we run into daily on the jQuery Mobile project is managing state between tests. Currently QUnit handles managing the DOM through the #qunit-fixtures wrapper but there are a myriad of other browser features that require handling.

A short list

  • Title
  • Hash
  • Query params
  • Local storage
  • Data objects
  • Event bindings

It should be noted that the last two can initially assume jQuery core as the DOM abstraction thanks to its ubiquity. This list is far from complete.

API suggestions

There will most certainly be cases that we can't think of in terms of managing and resetting state across tests. It would be nice to create the built in state management on top of an exposed api that allowed users to reset arbitrary objects and state between tests.

A an example:

https://gist.github.com/7431d5eb9226eda56168

Abstracting the state management of javascript objects into a simple API will help users create more stable tests.

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Jul 4, 2011

One note of importance. The example I gave does require the user to understand when javascript uses pass by reference (ie with objects) and to make sure they do in fact pass an object for management by QUnit.

One note of importance. The example I gave does require the user to understand when javascript uses pass by reference (ie with objects) and to make sure they do in fact pass an object for management by QUnit.

@jzaefferer

This comment has been minimized.

Show comment
Hide comment
@jzaefferer

jzaefferer Feb 15, 2012

Member

@johnbender same here. An example imeplementation of manage would help.

Member

jzaefferer commented Feb 15, 2012

@johnbender same here. An example imeplementation of manage would help.

@jzaefferer

This comment has been minimized.

Show comment
Hide comment
@jzaefferer

jzaefferer Mar 1, 2012

Member

Closing as a sort-of duplicate of #173, via John Bender.

Member

jzaefferer commented Mar 1, 2012

Closing as a sort-of duplicate of #173, via John Bender.

@jzaefferer jzaefferer closed this Mar 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment