Skip to content

Commit

Permalink
Add getStats unit test
Browse files Browse the repository at this point in the history
Since some Telemetry data depends on `getStats`, having a unit test should make it more diffucult to accidentally break this without noticing.
  • Loading branch information
Snuffleupagus committed Aug 30, 2014
1 parent 8042a4b commit fb7489f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unit/api_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor */
/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor,
isArray */

'use strict';

Expand Down Expand Up @@ -141,6 +142,13 @@ describe('api', function() {
expect(data.length).toEqual(105779);
});
});
it('gets stats', function() {
var promise = doc.getStats();
waitsForPromise(promise, function (stats) {
expect(isArray(stats.streamTypes)).toEqual(true);
expect(isArray(stats.fontTypes)).toEqual(true);
});
});
});
describe('Page', function() {
var resolvePromise;
Expand Down

0 comments on commit fb7489f

Please sign in to comment.