Skip to content

Instantly share code, notes, and snippets.

@rodneyrehm
Created July 16, 2014 20:55
Show Gist options
  • Save rodneyrehm/760c81da6f0f713444a5 to your computer and use it in GitHub Desktop.
Save rodneyrehm/760c81da6f0f713444a5 to your computer and use it in GitHub Desktop.
QUnit: why can't setup expose data to tests properly?
/*
Am I missing something here or is this really the way to go for a
module's setup function to expose something to the module's tests?
*/
(function() {
var filled_by_setup;
module('dummy module', {
setup: function() {
// prepare some data
filled_by_setup = Math.random();
}
});
test('something', function() {
equal(typeof filled_by_setup, 'Number', 'is it really?');
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment