Skip to content
Browse files

Trying to figure out why tests arent actually pausing

  • Loading branch information...
1 parent 1ab5510 commit aab01868fe20687760ef216486c8f15de84f09f2 @quirkey quirkey committed Jul 30, 2011
Showing with 13 additions and 2 deletions.
  1. +11 −2 test/test_sammy_storage.js
  2. +2 −0 vendor/qunit-spec.js
View
13 test/test_sammy_storage.js
@@ -1,9 +1,12 @@
(function($) {
+
with(QUnit) {
var stores = ['memory', 'local', 'session', 'cookie'];
- $.each(stores, function(i, store_type) {
+ var i = 0, l = stores.length;
+ for (; i < l; i++) {
+ var store_type = stores[i];
if (Sammy.Store.isAvailable(store_type)) {
context('Sammy.Store', store_type, {
before: function() {
@@ -20,9 +23,11 @@
type: store_type
});
stop();
+ console.log('stop in before')
this.store.clearAll(function() {
other_store.clearAll(function() {
start();
+ console.log('start in before')
});
});
}
@@ -38,6 +43,7 @@
})
.should('check if a key exists', function() {
expect(4);
+ console.log('-- stop key exists');
stop();
var store = this.store, other_store = this.other_store;
store.exists('foo', function(foo) {
@@ -48,6 +54,7 @@
equal(after_set, true);
other_store.exists('foo', function(foo3) {
ok(!foo3);
+ console.log('-- start key exists');
// start();
});
});
@@ -57,6 +64,7 @@
.should('set and retrieve value as string', function() {
expect(4);
stop();
+ console.log('-- stop value as a string');
var store = this.store, other_store = this.other_store;
store.set('foo', 'bar', function(newval, key) {
equal(key, 'foo');
@@ -65,6 +73,7 @@
equal(val, 'bar');
other_store.get('foo', function(val) {
ok(!val);
+ console.log(' -- start value as a string')
start();
});
});
@@ -155,7 +164,7 @@
});
});
}
- });
+ }
context('Sammy.Storage', {
before: function() {
View
2 vendor/qunit-spec.js
@@ -33,9 +33,11 @@
var spec = this;
var spec_context = {};
QUnit.test(name, function() {
+ console.log('------- test ', name, spec_context);
if (spec.before) spec.before.apply(spec_context);
callback.apply(spec_context, [this, spec]);
if (spec.after) spec.after.apply(spec_context);
+ console.log('------ finished ', name, spec_context);
});
return spec;
},

0 comments on commit aab0186

Please sign in to comment.
Something went wrong with that request. Please try again.