1

我尝试在 Firefox Addon SDK 1.14 和 Firefox 25 下进行单元测试。

参考https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/unit-testing.html我希望我的测试能在控制台上打印一些东西。

const {DateFormatter, NumberFormatter} = require("./formatter");

exports['test NumberFormatter'] = function (assert) {
    assert.pass('Unit test running!');
    assert.ok(NumberFormatter.format !== null, 'NumberFormatter available');
};

exports["test NumberFormatter async"] = function (assert, done) {
    assert.pass("async Unit test running!");
    done();
};

require("sdk/test").run(exports);

结果是:

(d:\Nabor\Entwicklung\2013\addon-sdk) d:\Nabor\Entwicklung\2013\skynet\packages\formatter>cfx test
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\temp\nabor\tmptzmpba.mozrunner'.
Running tests on Firefox 25.0/Gecko 25.0 ({ec8030f7-c20a-464f-9b0e-13a3a9e97384}) under winnt/x86-msvc.
...
3 of 3 tests passed.
Total time: 1.588000 seconds
Program terminated successfully.

我错过了示例中的信息?

怎么了?

4

1 回答 1

3

猜测:缺少 --verbose 标志

cfx --verbose test
于 2013-11-11T23:32:33.057 回答