dwf/rva: started suite testing.

This commit is contained in:
pivotal 2008-12-01 17:57:21 -08:00
parent 7a95f3344c
commit be33f1e6d4
3 changed files with 75 additions and 18 deletions

View File

@ -89,10 +89,10 @@
</provider>
</entry>
</file>
<file leaf-file-name="bootstrap.js" pinned="false" current="true" current-in-tab="true">
<file leaf-file-name="bootstrap.js" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/bootstrap.js">
<provider selected="true" editor-type-id="text-editor">
<state line="239" column="43" selection-start="6804" selection-end="6804" vertical-scroll-proportion="0.28954938">
<state line="295" column="2" selection-start="8248" selection-end="8248" vertical-scroll-proportion="0.4717162">
<folding />
</state>
</provider>
@ -107,10 +107,10 @@
</provider>
</entry>
</file>
<file leaf-file-name="jasmine.js" pinned="false" current="false" current-in-tab="false">
<file leaf-file-name="jasmine.js" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/jasmine.js">
<provider selected="true" editor-type-id="text-editor">
<state line="88" column="0" selection-start="2048" selection-end="2048" vertical-scroll-proportion="0.2422179">
<state line="131" column="32" selection-start="2951" selection-end="2951" vertical-scroll-proportion="0.29766536">
<folding />
</state>
</provider>
@ -224,6 +224,28 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="jasmine" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="jasmine" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PsiDirectory:/Users/pivotal/Desktop/jasmine" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PsiDirectory:/Users/pivotal/Desktop/jasmine/jspec" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="PsiDirectory:/Users/pivotal/Desktop/jasmine/jspec/test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="jasmine" />
@ -532,16 +554,23 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/jasmine.js">
<entry file="file://$PROJECT_DIR$/jspec/test/test.js">
<provider selected="true" editor-type-id="text-editor">
<state line="88" column="0" selection-start="2048" selection-end="2048" vertical-scroll-proportion="0.2422179">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/bootstrap.js">
<provider selected="true" editor-type-id="text-editor">
<state line="239" column="43" selection-start="6804" selection-end="6804" vertical-scroll-proportion="0.28954938">
<state line="295" column="2" selection-start="8248" selection-end="8248" vertical-scroll-proportion="0.4717162">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/jasmine.js">
<provider selected="true" editor-type-id="text-editor">
<state line="131" column="32" selection-start="2951" selection-end="2951" vertical-scroll-proportion="0.29766536">
<folding />
</state>
</provider>

View File

@ -123,17 +123,31 @@ var it = function (description) {
}
that.resetTimeout();
return that;
}
that.runs = addToQueue;
that.then = addToQueue;
currentSuite.tests.push(that);
return that;
}
var currentSuite;
var describe = function (description, tests) {
var that = {
description: description,
tests: []
}
currentSuite = that;
tests();
return that;
}
/*
* Jasmine constructor
*/

34
test/bootstrap.js vendored
View File

@ -282,23 +282,37 @@ var waitForDone = function(spec, mockSuite) {
}, 150);
}
var testSuites = function () {
// suite has a description
var suite = describe('one suite description', function() {});
reporter.test((suite.description == 'one suite description'),
'Suite did not get a description');
// suite can have a test
suite = describe('one suite description', function () {
it('should be a test');
});
reporter.test((suite.tests[0].queue.length === 1),
'Suite did not get a test pushed');
}
var runTests = function () {
$('spinner').show();
testMatchersComparisons();
testMatchersReporting();
testSpecs();
testAsyncSpecs();
testAsyncSpecsWithMockSuite();
// testMatchersComparisons();
// testMatchersReporting();
// testSpecs();
// testAsyncSpecs();
// testAsyncSpecsWithMockSuite();
testSuites();
setTimeout(function() {
$('spinner').hide();
reporter.summary();
}, 10000);
}, 100);
}
//it('should be an async test') {
// run(function() {setup}).and.wait(2000).then.expects_that(true).should_equal(true).and.expects_that
//}