diff --git a/test/spec/HTMLInstrumentation-test.js b/test/spec/HTMLInstrumentation-test.js index 9c4b37150..a390f427f 100644 --- a/test/spec/HTMLInstrumentation-test.js +++ b/test/spec/HTMLInstrumentation-test.js @@ -148,13 +148,12 @@ define(function (require, exports, module) { it("should have recreated cache when document timestamp is different", function () { runs(function () { - var docTimestamp = editor.document.diskTimestamp.getTime(); - - // Arbitararily change the diskTimestamp - editor.document.diskTimestamp += 12345; + // update document timestamp with current time. + editor.document.diskTimestamp = new Date(); // This is an intentional repeat call to recreate the cache. HTMLInstrumentation.scanDocument(editor.document); + // 2 calls from generateInstrumentedHTML call and one call // from above scanDocument call. so total is 3. expect(editor.document.getText.callCount).toBe(3);