Skip to content

Commit 3944a96

Browse files
committed
(test) sets initial parameters
1 parent d7c630a commit 3944a96

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import Automizer from "../src/automizer"
22

33
test("create presentation and append charts to existing charts", async () => {
4-
const templateFolder = `${__dirname}/../__tests__/pptx-templates/`
5-
const outputFolder = `${__dirname}/../__tests__/pptx-output/`
6-
7-
const automizer = new Automizer()
8-
let pres = automizer.importRootTemplate(`${templateFolder}RootTemplateWithCharts.pptx`)
9-
.importTemplate(`${templateFolder}SlideWithCharts.pptx`, 'charts')
4+
const automizer = new Automizer({
5+
templateDir: `${__dirname}/pptx-templates`,
6+
outputDir: `${__dirname}/pptx-output`
7+
})
8+
9+
let pres = automizer.importRootTemplate(`RootTemplateWithCharts.pptx`)
10+
.importTemplate(`SlideWithCharts.pptx`, 'charts')
1011

1112
pres.addSlide('charts', 1)
1213

13-
await pres.write(`${outputFolder}myPresentation.pptx`)
14+
await pres.write(`myPresentation.pptx`)
1415

1516
expect(pres).toBeInstanceOf(Automizer)
1617
})

__tests__/create-presentation-images.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import Automizer from "../src/automizer"
22

33
test("create presentation and append slides with images", async () => {
44
const automizer = new Automizer({
5-
templateDir: `${__dirname}/../__tests__/pptx-templates`,
6-
outputDir: `${__dirname}/../__tests__/pptx-output`
5+
templateDir: `${__dirname}/pptx-templates`,
6+
outputDir: `${__dirname}/pptx-output`
77
})
88

99
let pres = automizer.importRootTemplate(`RootTemplateWithCharts.pptx`)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import Automizer from "../src/automizer"
22

33
test("create presentation and add basic slide", async () => {
4-
const templateFolder = `${__dirname}/../__tests__/pptx-templates/`
5-
const outputFolder = `${__dirname}/../__tests__/pptx-output/`
6-
7-
const automizer = new Automizer()
8-
let pres = automizer.importRootTemplate(`${templateFolder}RootTemplate.pptx`)
9-
.importTemplate(`${templateFolder}SlideWithShapes.pptx`, 'shapes')
4+
const automizer = new Automizer({
5+
templateDir: `${__dirname}/pptx-templates`,
6+
outputDir: `${__dirname}/pptx-output`
7+
})
8+
let pres = automizer.importRootTemplate(`RootTemplate.pptx`)
9+
.importTemplate(`SlideWithShapes.pptx`, 'shapes')
1010

1111
for(let i=0; i<=10; i++) {
1212
pres.addSlide('shapes', 1)
1313
}
1414

15-
await pres.write(`${outputFolder}myPresentation.pptx`)
15+
await pres.write(`myPresentation.pptx`)
1616

1717
expect(pres).toBeInstanceOf(Automizer)
1818
})

0 commit comments

Comments
 (0)