Beispiel #1
0
 it('verify the Office PP can detect if it is configured correctly.', function(callback) {
     var config = {
         'previews': {
             'office': {
                 'binary': 'some-none-existinant-binary'
             }
         }
     };
     PreviewOffice.init(config, function(err) {
         assert.ok(err);
         assert.equal(err.code, 500);
         callback();
     });
 });
Beispiel #2
0
        it('verify office processing works', function(callback) {
            // Ignore this test if the PP is disabled.
            if (!defaultConfig.previews.enabled) {
                return callback();
            }

            ctx = getPreviewContext(__dirname + '/data/word.docx');

            PreviewOffice.generatePreviews(ctx, function(err) {
                assert.ok(!err);
                verifyPreviews(ctx, 6);
                assert.equal(ctx.getMetadata().pageCount, 2);
                callback();
            });
        });