diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index e3af963e4..c6bf6609e 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1,7 +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, - isArray */ + isArray, MissingPDFException */ 'use strict'; @@ -79,6 +79,14 @@ describe('api', function() { expect(true).toEqual(true); }); }); + it('creates pdf doc from non-existent URL', function() { + var nonExistentUrl = combineUrl(window.location.href, + '../pdfs/non-existent.pdf'); + var promise = PDFJS.getDocument(nonExistentUrl); + waitsForPromiseRejected(promise, function(error) { + expect(error instanceof MissingPDFException).toEqual(true); + }); + }); }); }); describe('PDFDocument', function() {