<!DOCTYPE html>
<!--
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">

<script src="/chai/chai.js"></script>
<script>
  'use strict';
  /**
   * Alias chai assert to the global assert.
   */
  if (tr.isNode) {
    // In node, chai.js knows to act as a node module, whereas our HTML
    // imports code expects chai to end up in the global scope. So, in Node,
    // copy the chai exports into global.
    var chaiAbsPath = HTMLImportsLoader.hrefToAbsolutePath(
        '/chai/chai.js');
    var chaiModule = require(chaiAbsPath);
    for (var exportName in chaiModule)
      global[exportName] = chaiModule[exportName];
  } else {
    /**
     * Catapult presubmit wanted me to put a jsdoc here. So nduca did.
     */
    global.assert = chai.assert;
  }
</script>

<link rel="import" href="/tracing/base/unittest/suite_loader.html">
<link rel="import" href="/tracing/base/unittest/test_case.html">
<link rel="import" href="/tracing/base/unittest/test_suite.html">
<link rel="import" href="/tracing/base/unittest/test_runner.html">
<script>
'use strict';
tr.exportTo('tr.b.unittest', function() {
  return {
  };
});
</script>

<!DOCTYPE html>
<!--
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/base.html">

<script src="/chai/chai.js"></script>
<script>
  'use strict';
  /**
   * Alias chai assert to the global assert.
   */
  if (tr.isNode) {
    // In node, chai.js knows to act as a node module, whereas our HTML
    // imports code expects chai to end up in the global scope. So, in Node,
    // copy the chai exports into global.
    var chaiAbsPath = HTMLImportsLoader.hrefToAbsolutePath(
        '/chai/chai.js');
    var chaiModule = require(chaiAbsPath);
    for (var exportName in chaiModule)
      global[exportName] = chaiModule[exportName];
  } else {
    // https://github.com/catapult-project/catapult/issues/3097
    chai.config.includeStack = true;

    /**
     * Catapult presubmit wanted me to put a jsdoc here. So nduca did.
     */
    global.assert = chai.assert;
  }
</script>

<link rel="import" href="/tracing/base/unittest/suite_loader.html">
<link rel="import" href="/tracing/base/unittest/test_case.html">
<link rel="import" href="/tracing/base/unittest/test_runner.html">
<link rel="import" href="/tracing/base/unittest/test_suite.html">

Configure chai to include stack traces.
Configure chai to include stack traces.

Currently, when assert.isTrue() or isFalse() false, it displays a very unhelpful
message that doesn't even distinguish which assertion failed.
Enabling this feature will cause chai to display stack traces when assertions
fail.

BUG=catapult:#3097

Review-Url: https://codereview.chromium.org/2618713003
