Skip to content

Commit

Permalink
test: Fixed the tests
Browse files Browse the repository at this point in the history
Fixed the tests to work on the CI environment.
  • Loading branch information
Ziv-Barber committed Oct 26, 2018
1 parent 9820c98 commit 4e961ca
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .eslintrc
Expand Up @@ -13,7 +13,7 @@
"flowtype"
],
"env": {
"jest": true,
"mocha": true,
"browser": true,
"node": true,
"es6": true
Expand Down
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,27 @@
### Environment

1. `node -v`: [fill]
1. `npm -v`: [fill]
1. `npm ls officegen`: [fill]
1. Operating system: [fill]
1. Microsoft Office version: [fill]
1. Problem with Powerpoint, Excel or Word document: [fill]

### Steps to Reproduce

<!-- Please create a repository that reproduces the issue with the minimal amount of code possible. -->

[fill]

### Expected Behavior

[fill]

### Actual Behavior

[fill]

---

An example code will be the best.
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself.
9 changes: 9 additions & 0 deletions tests/docx-header-footer.test.js
Expand Up @@ -42,6 +42,15 @@ var onError = function (err) {
describe('DOCX generator with header and footer', function () {
this.timeout(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a document with header and footer', function (done) {
var docx = officegen({
type: 'docx',
Expand Down
9 changes: 9 additions & 0 deletions tests/docx.test.js
Expand Up @@ -41,6 +41,15 @@ var onError = function (err) {
describe('DOCX generator', function () {
this.timeout(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a document with text and styles', function (done) {
var docx = officegen('docx')
docx.on('error', onError)
Expand Down
9 changes: 9 additions & 0 deletions tests/pptx-charts.test.js
Expand Up @@ -41,6 +41,15 @@ var onError = function (err) {
describe('PPTX generator', function () {
this.slow(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a slides with charts', function (done) {
var pptx = officegen({ type: 'pptx', tempDir: outDir })
pptx.on('error', onError)
Expand Down
9 changes: 9 additions & 0 deletions tests/pptx-layouts.test.js
Expand Up @@ -42,6 +42,15 @@ var onError = function (err) {
describe('PPTX Layouts plugin', function () {
this.slow(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a presentation with the title layout', function (done) {
var slide
var pptx = officegen({
Expand Down
9 changes: 9 additions & 0 deletions tests/pptx-speakernotes.test.js
Expand Up @@ -40,6 +40,15 @@ var onError = function (err) {
describe('PPTX Speaker Notes plugin', function () {
this.slow(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a presentation with one speaker note', function (done) {
var slide
var pptx = officegen('pptx')
Expand Down
9 changes: 9 additions & 0 deletions tests/pptx.test.js
Expand Up @@ -40,6 +40,15 @@ var onError = function (err) {
describe('PPTX generator', function () {
this.slow(1000)

before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a presentation with properties and text', function (done) {
var pptx = officegen('pptx')
pptx.on('error', onError)
Expand Down
9 changes: 9 additions & 0 deletions tests/xlsx-test.js
Expand Up @@ -38,6 +38,15 @@ var onError = function (err) {
}

describe('XLSX generator', function () {
before(function (done) {
fs.mkdir(outDir, 0o777, function (err) {
if (err) {
} // Endif.

done()
})
})

it('creates a spreadsheet with text and numbers', function (done) {
var xlsx = officegen('xlsx')
xlsx.on('error', onError)
Expand Down

0 comments on commit 4e961ca

Please sign in to comment.