このようなテストケースを実行すると、テスト結果がYUIテストコンソールウィジェット内に表示されます。
YUI({debug: true}).use('test', 'event-base', 'test-console', function (Y) {
fooTests = new Y.Test.Case({
name: "foo",
testFoo: function () {
Y.assert(5 == 6);
}
});
Y.on("domready", function () {
(new Y.Test.Console({
newestOnTop: false,
style: 'block'
})).render('#log');
Y.Test.Runner.add(fooTests);
Y.Test.Runner.run();
});
});
まったく同じコードを実行したが、最初に「test」を使用する別のYUIインスタンスを作成した場合、テストはブラウザーのjavascriptコンソールに表示されます(開いている場合)。
YUI({debug: true}).use('test', function (Y) {
});
YUI({debug: true}).use('test', 'event-base', 'test-console', function (Y) {
fooTests = new Y.Test.Case({
name: "foo",
testFoo: function () {
Y.assert(5 == 6);
}
});
Y.on("domready", function () {
(new Y.Test.Console({
newestOnTop: false,
style: 'block'
})).render('#log');
Y.Test.Runner.add(fooTests);
Y.Test.Runner.run();
});
});
'test'が別のYUIインスタンスで使用されている場合に、結果をtest-consoleウィジェットに表示する方法はありますか?