blob: 0bf8072226b989fb793b7e9bb2a792df3f147eb9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>error_test.html</title>
<link rel="stylesheet" href="/filez/_main/third_party/js/qunit/qunit.css">
<script src="/filez/_main/third_party/js/qunit/qunit.js"></script>
<script src="/filez/_main/third_party/js/qunit/qunit_test_runner.js"></script>
<script src="test_bootstrap.js"></script>
<script>
goog.require('bot.Error');
goog.require('bot.ErrorCode');
</script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script>
QUnit.test('converts code to state', function(assert) {
var e = new bot.Error(bot.ErrorCode.NO_SUCH_ELEMENT, 'boom');
assert.strictEqual(e.code, bot.ErrorCode.NO_SUCH_ELEMENT);
assert.strictEqual(e.state, bot.Error.State.NO_SUCH_ELEMENT);
assert.strictEqual(e.name, 'NoSuchElementError');
});
</script>
</body>
</html>