小编Sus*_*hil的帖子

在页面中水平居中DIV

我正在尝试将一个div集中,这是用于HTML5/JavaScript的Windows 8应用程序的Microsoft pubCenter AdControl.

    <div id="myAd" style="; top: 0%; width: 292px; height: 60px; z-index: 1"
        data-win-control="MicrosoftNSJS.Advertising.AdControl"
        data-win-options="{applicationId: 'exampleAdId', adUnitId: 'exampleAdUnit'}">
    </div>
Run Code Online (Sandbox Code Playgroud)

如何将div水平居中,使其始终位于页面中间?

html html5 microsoft-metro windows-8 winjs

11
推荐指数
2
解决办法
7万
查看次数

有没有办法让 mocha 打印错误对象而不是错误消息?

让我举个例子。

before(function (done)
{
    ...
    testUtils.someInitWork(done);
});

testUtils = {
    someInitWork: function (done)
    {
        ...
        if (e)
            // wrap the error into another error object and add contextual information.
            e2 = errorManager.getError('myerror', e, { context: "more context for the error });
    }
};
Run Code Online (Sandbox Code Playgroud)

当测试初始化​​代码在 util 函数的深处失败时,它会将所需的上下文信息传递到错误对象中。这个错误对象最终会传递给 before 的 done 回调。mocha 在控制台上打印错误消息(我使用的是记者规范)。相反,如果我可以打印它util.inspect(e)- 该信息对于调试问题将更有用。

当然,我可以修改测试代码打印出来。但是有没有办法修改 mocha 在控制台上报告错误(传递给回调之前)的方式?

mocha.js node.js

6
推荐指数
0
解决办法
624
查看次数

标签 统计

html ×1

html5 ×1

microsoft-metro ×1

mocha.js ×1

node.js ×1

windows-8 ×1

winjs ×1