Skip to content
DouglasMeyer edited this page Oct 20, 2011 · 5 revisions

Better naming (easy to use)

Renaming TestIt.Context to TestIt.Collection and TestIt.Assertion to TestIt.Context. This will hopefully make it easier to add assertions/helpers, as I'm thinking of making TestIt.Context the context of the actual test:

TestIt.Context.prototype.myHelper = function(){/* ...*/};
TestIt('my tests', {
  'should be awesome': function(){
    this.myHelper();
    this.assert(something);
  }
});

Easier to add custom assertions (easy to use)

Currently you have to

TestIt('my tests', {
  'before each': function(t){
    t.myAssertion = function(){/* ... */};
  },

  'tests ...': {/* ... */}
});

but it would probably be better to

MyTestIt = TestIt.clone();
MyTestIt.Context.prototype.myAssertion = function(){/* ... */}
MyTestIt('my tests', {
  'test': function(){
    this.myAssertion(/* ... */);
  }
});

This would make it easier to add assertions to multiple test cases.

Easier to write extensions (easy to use)

Currently you have to

myExtension = { 'before all': function(){/* ... */} };
TestIt('my tests', {
  'tests ...': {/* ... */}
}, myExtension);

but it would probably be better to

MyTestIt = TestIt.clone();
MyTestIt['before all'] = function(){/* ... */};
MyTestIt('my tests', {
  'tests ...': {/* ... */}
});

This would make it easier to use multiple extensions for multiple test cases.

More standard reporting (powerful, easy to use)

Currently you have to

myReporter = function(name, status, assertionCount, message){/* ... */};
TestIt('my tests', {
  'tests ...': {/* ... */}
}, myReporter);

but it would probably be better to

MyTestIt = TestIt.clone();
MyTestIt.defaultReporting = false;
MyTestIt.bind('fail', function(testContext){/* ... */});
MyTestIt.bind('reporting', function(testContext){/* ... */});
MyTestIt('my tests', {
  'tests ...': {/* ... */}
});

This would make it easier to (per test case):

  • use custom reporting
  • continue (or stop) using the default reporting
  • allow extensions to report on testContext information

Easier to extend (powerful, easy to use)

Instead of having a bunch of bindings

MyTestIt = TestIt.clone();
MyTestIt.Context.prototype.myAssertion = function(){/* ... */};
MyTestIt.defaultReporting = false;
MyTestIt['before each'] = function(t){/* ... */};
MyTestIt.bind('reporting', function(testContext){/* ... */});

but it would probably be better to

MyTestIt = TestIt.clone({
  'helpers': {
    myAssertion: function(){/* ... */}
  },
  'defaultReporting': false,
  'before each': function(t){/* ... */},
  'reporting': function(testContext){/* ... */}
});

Provide default styling (easy to get started)

Currently the framework doesn't provide styling for in-browser tests. While it is nice to give the user more control over the look of their tests; if you are just starting out and want styling for your tests, it would be nice if that was avalable. It would be nice if this were avalable:

<link href="http://raw.github.com/DouglasMeyer/test_it/1.2.3/src/test_it.css" media="screen" rel="stylesheet" type="text/css" />