aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/commonjs/export_asserts.js
blob: 16abdd7dee7b43e137c2533050771d9605744b62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * @fileoverview Description of this file.
 */

goog.require('goog.testing.asserts');

var global = Function('return this')();

// The Google Closure assert functions start with assert, eg.
//   assertThrows
//   assertNotThrows
//   assertTrue
//   ...
//
// The one exception is the "fail" function.
function shouldExport(str) {
  return str.lastIndexOf('assert') === 0 || str == 'fail';
}

for (var key in global) {
  if ((typeof key == "string") && global.hasOwnProperty(key) &&
      shouldExport(key)) {
    exports[key] = global[key];
  }
}

exports.COMPILED = COMPILED