LoginSignup
0
1

More than 5 years have passed since last update.

qunit + power-assertで正しく表示する

Last updated at Posted at 2015-05-16

https://github.com/twada/power-assert-demo の通りに
qunitとpower-assertを組み合わせると表示が崩れてしまいます。

そこで以下のようにスタイルを設定します。

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>QUnit Test Suite</title>
  <link  href="../bower_components/qunit/qunit/qunit.css" rel="stylesheet" />
  <script src="../bower_components/qunit/qunit/qunit.js"></script>
  <script src="../bower_components/qunit-tap/lib/qunit-tap.js"></script>
  <script>qunitTap(QUnit, function() { console.log.apply(console, arguments); }, {showSourceOnFailure: false});</script>

  <script src="../bower_components/empower/build/empower.js"></script>
  <script src="../bower_components/power-assert-formatter/build/power-assert-formatter.js"></script>
  <script>empower(QUnit.assert, powerAssertFormatter({lineSeparator:"\n"}), {destructive: true});</script>
  <style>
    .test-message{
      white-space: pre;
      font-family: Osaka-mono, "Osaka-等幅", "MS ゴシック", monospace;
      font-size: 14px;
    }
  </style>

  <script src="../src/mylibrary.js"></script>

  <script src="../test/testMylibrary.espowered.js"></script>
</head>
<body>
  <h1 id="qunit-header">QUnit Test Suite</h1>
  <h2 id="qunit-banner"></h2>
  <div id="qunit-testrunner-toolbar"></div>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <div id="qunit-fixture">test markup</div>
</body>
</html>

うまくいきました。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1