Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix tests which were broken in browsers

  • Loading branch information...
commit 413efa5d22d3cbd5f0991e8b3219a029dd10caca 1 parent f32ea09
@joewalker authored
Showing with 5 additions and 4 deletions.
  1. +4 −3 test/browser_templater_basic.js
  2. +1 −1  test/harness.js
View
7 test/browser_templater_basic.js
@@ -38,7 +38,8 @@ function runTest(index) {
is(holder.innerHTML, options.result, options.name);
}
else {
- ok(holder.innerHTML.match(options.result), options.name);
+ ok(holder.innerHTML.match(options.result) != null,
+ options.name + ' result=\'' + holder.innerHTML + '\'');
}
if (options.also) {
@@ -158,7 +159,7 @@ var tests = [
data: { name: 'pass 8' },
result: '<p>pass 8</p>',
also: function(options) {
- ok(options.data.element.innerHTML, 'pass 9', 'saveElement saved');
+ is(options.data.element.innerHTML, 'pass 8', 'saveElement saved');
delete options.data.element;
}
};},
@@ -170,7 +171,7 @@ var tests = [
data: {
adjust: function(element) {
is('pass9', element.id, 'useElement adjust');
- return 'pass 9b'
+ return 'pass 9b';
}
},
result: '<p id="pass9">pass 9b</p>'
View
2  test/harness.js
@@ -37,7 +37,7 @@ function is(actual, expected, name) {
}
function ok(test, name) {
- if (test !== true) {
+ if (!test) {
console.error('Assertion fail: ' + name);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.