Enable running the ui_utils unit-tests on Travis

With the exception of just one test-case, all the current `ui_utils` unit-tests can run successfully on Node.js (since most of them doesn't rely on the DOM).

To get this working, I had to first of all add a new `LIB` build flag such that `gulp lib` produces a `web/pdfjs.js` file that is able to load `pdf.js` successfully.
Second of all, since neither `document` nor `navigator` is available in Node.js, `web/ui_utils.js` was adjusted slightly to avoid errors.
This commit is contained in:
Jonas Jenwald 2017-04-24 22:07:00 +02:00
parent 5fe26bb9da
commit ae04cf1c37
5 changed files with 17 additions and 4 deletions

View file

@ -77,6 +77,7 @@ var DEFINES = {
MINIFIED: false,
SINGLE_FILE: false,
COMPONENTS: false,
LIB: false,
PDFJS_NEXT: false,
};
@ -998,6 +999,7 @@ gulp.task('lib', ['buildnumber'], function () {
saveComments: false,
defines: builder.merge(DEFINES, {
GENERIC: true,
LIB: true,
BUNDLE_VERSION: versionInfo.version,
BUNDLE_BUILD: versionInfo.commit
})