28-解决方案
18.7.2 解决方案
可以用 module() 函数对测试分组:
module("group a");
test("a basic test example", function() {
ok( true, "this test is fine" );
});
test("a basic test example 2", function() {
ok( true, "this test is fine" );
});
module("group b");
test("a basic test example 3", function() {
ok( true, "this test is fine" );
});
test("a basic test example 4", function() {
ok( true, "this test is fine" );
});
所有在调用 module() 之后发生的测试将集中到一个模块。在测试结果中的测试名称前面加上模块名称。以后,可以使用模块名称选择运行的测试(见秘诀18.8)。