Bläddra i källkod

Updated windows path to linux.

tags/v1.0.0
Kalimuthu Selvaraj 5 år sedan
förälder
incheckning
20fb594863
7 ändrade filer med 40 tillägg och 24 borttagningar
  1. 0
    2
      .gitignore
  2. 18
    0
      sample.js
  3. Binär
      source/file_example_ODP_1MB.odp
  4. 0
    0
      source/sample.txt
  5. Binär
      test/source/Metro_Style.pdf
  6. Binär
      test/source/Metro_Style.pptx
  7. 22
    22
      test/test.js

+ 0
- 2
.gitignore Visa fil

@@ -1,5 +1,3 @@
node_modules
source
files
coverage
.nyc_output

+ 18
- 0
sample.js Visa fil

@@ -0,0 +1,18 @@
const document = require("./convert");
var path = require("path");
// const options = {
// libreofficeBin: "C:\\Program Files\\LibreOffice\\program\\soffice.exe",
// sourceFile: "C:\\node\\document-convert\\source\\Metro_Style.pptx",
// outputDir: "C:\\node\\document-convert\\files\\",
// img: true,
// imgExt: "jpg",
// reSize: "-resize",
// density: 120,
// };

// document.convert(options).catch((e) => {
// console.log("e", e.message);
// });
global.appRoot = path.resolve(__dirname);
console.log(global.appRoot);
//nyc --reporter=html --reporter=text mocha test/*.js --timeout 1500000

Binär
source/file_example_ODP_1MB.odp Visa fil


+ 0
- 0
source/sample.txt Visa fil


Binär
test/source/Metro_Style.pdf Visa fil


Binär
test/source/Metro_Style.pptx Visa fil


+ 22
- 22
test/test.js Visa fil

@@ -28,28 +28,28 @@ describe("Convert files to pdf or/and image", function () {
});
});

// it("should convert pdf to image", function () {
// options.sourceFile = "C:\\node\\document-convert\\source\\Metro_Style.pdf";
// options.outputDir = "C:\\node\\document-convert\\files\\";
// options.reSize = 800;
// document.convert(options).then((res) => {
// expect(res).to.equal("Success");
// });
// });
it("should convert pdf to image", function () {
options.sourceFile = `${global.appRoot}/source/Metro_Style.pdf`;
options.outputDir = `${global.appRoot}/files/`;
options.reSize = 800;
document.convert(options).then((res) => {
expect(res).to.equal("Success");
});
});

// it("should convert pdf only", function (done) {
// options.sourceFile = "C:\\node\\document-convert\\source\\Metro_Style.pptx";
// options.img = false;
// document.convert(options).then((res) => {
// expect(res).to.equal("Success");
// done();
// });
// });
it("should convert pdf only", function (done) {
options.sourceFile = `${global.appRoot}/source/Metro_Style.pptx`;
options.img = false;
document.convert(options).then((res) => {
expect(res).to.equal("Success");
done();
});
});

// it("should convert without resize, density and imgExt", function () {
// options.img = true;
// document.convert(options).then((res) => {
// expect(res).to.equal("Success");
// });
// });
it("should convert without resize, density and imgExt", function () {
options.img = true;
document.convert(options).then((res) => {
expect(res).to.equal("Success");
});
});
});

Laddar…
Avbryt
Spara