Skip to content

Commit

Permalink
fixup! Fix last modified test to be more correct and stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Jan 9, 2015
1 parent 7ca229b commit 8070515
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -10,7 +10,7 @@
var expected = Math.round(d / 1000);

test(function() {
assert_approx_equals(initial_modified, expected, 1.5);
assert_approx_equals(initial_modified, expected, 2.5);
}, "Date returned by lastModified is current at page load");

var pattern = /[0-9]{2}\/[0-9]{2}\/[0-9]{4} ([0-9]{2}):([0-9]{2}):([0-9]{2})/
Expand Down Expand Up @@ -39,8 +39,9 @@
t.step(function() {
var new_modified = Date.parse(document.lastModified) / 1000;
var new_expected = Math.round(new Date() / 1000);
assert_approx_equals(new_modified, new_expected, 1.5, "(initial value was " + initial_modified + ")");
assert_approx_equals(new_modified, new_expected, 2.5,
"(initial value was " + initial_modified + ")");
t.done();
});
}, 3000);
}, 4000);
</script>

0 comments on commit 8070515

Please sign in to comment.