diff --git a/tests/__tests__/report_files.test.js b/tests/__tests__/report_files.test.js index f69d2ad3..e2d5a5a6 100644 --- a/tests/__tests__/report_files.test.js +++ b/tests/__tests__/report_files.test.js @@ -49,12 +49,18 @@ test('report dir is correctly created', async () => { expect(fs.existsSync(path.join(outdir.name, 'report.html'))).toBeTruthy(); }); +test('expanded EPUBs are supported', async () => { + expect.assertions(1); + await runAce(path.join(__dirname, '../data/base-epub-30')); + expect(fs.existsSync(path.join(outdir.name, 'report.html'))).toBeTruthy(); +}); + test('files don’t leak outside the report dir', async () => { // Add another directory level to prevent any leak in the user's temp dir const outpath = path.join(outdir.name, 'report'); fs.mkdirSync(outpath); expect.assertions(2); - await runAce(path.join(__dirname, '../data/issue33.epub'), { outpath }); + await runAce(path.join(__dirname, '../data/issue33'), { outpath }); expect(fs.existsSync(path.join(outpath, 'report.html'))).toBeTruthy(); expect(fs.existsSync(path.join(outpath, 'data/EPUB/images/img_001.jpg'))).toBeTruthy(); }); diff --git a/tests/data/base-epub-30/EPUB/content_001.xhtml b/tests/data/base-epub-30/EPUB/content_001.xhtml new file mode 100644 index 00000000..c55a9e8b --- /dev/null +++ b/tests/data/base-epub-30/EPUB/content_001.xhtml @@ -0,0 +1,9 @@ + + +Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + diff --git a/tests/data/base-epub-30/EPUB/nav.xhtml b/tests/data/base-epub-30/EPUB/nav.xhtml new file mode 100644 index 00000000..1d538c19 --- /dev/null +++ b/tests/data/base-epub-30/EPUB/nav.xhtml @@ -0,0 +1,12 @@ + + +Minimal Nav + + + + + diff --git a/tests/data/base-epub-30/EPUB/package.opf b/tests/data/base-epub-30/EPUB/package.opf new file mode 100644 index 00000000..8e218285 --- /dev/null +++ b/tests/data/base-epub-30/EPUB/package.opf @@ -0,0 +1,16 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-01-01T00:00:01Z + + + + + + + + + diff --git a/tests/data/base-epub-30/META-INF/container.xml b/tests/data/base-epub-30/META-INF/container.xml new file mode 100644 index 00000000..2cf00654 --- /dev/null +++ b/tests/data/base-epub-30/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/data/base-epub-30/mimetype b/tests/data/base-epub-30/mimetype new file mode 100644 index 00000000..57ef03f2 --- /dev/null +++ b/tests/data/base-epub-30/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/tests/data/issue33.epub b/tests/data/issue33.epub deleted file mode 100644 index 458dc86d..00000000 Binary files a/tests/data/issue33.epub and /dev/null differ diff --git a/tests/data/issue33/EPUB/html/ch1/content_001.xhtml b/tests/data/issue33/EPUB/html/ch1/content_001.xhtml new file mode 100644 index 00000000..708b0e59 --- /dev/null +++ b/tests/data/issue33/EPUB/html/ch1/content_001.xhtml @@ -0,0 +1,10 @@ + + +Minimal EPUB + + +

Loomings

+

Call me Ishmael.

+ + + diff --git a/tests/data/issue33/EPUB/images/img_001.jpg b/tests/data/issue33/EPUB/images/img_001.jpg new file mode 100644 index 00000000..4da4ea9f Binary files /dev/null and b/tests/data/issue33/EPUB/images/img_001.jpg differ diff --git a/tests/data/issue33/EPUB/nav.xhtml b/tests/data/issue33/EPUB/nav.xhtml new file mode 100644 index 00000000..17209256 --- /dev/null +++ b/tests/data/issue33/EPUB/nav.xhtml @@ -0,0 +1,12 @@ + + +Minimal Nav + + + + + diff --git a/tests/data/issue33/EPUB/package.opf b/tests/data/issue33/EPUB/package.opf new file mode 100644 index 00000000..aacc3e02 --- /dev/null +++ b/tests/data/issue33/EPUB/package.opf @@ -0,0 +1,17 @@ + + + + Ace Issue #33 + en + NOID + 2017-01-01T00:00:01Z + + + + + + + + + + diff --git a/tests/data/issue33/META-INF/container.xml b/tests/data/issue33/META-INF/container.xml new file mode 100644 index 00000000..2cf00654 --- /dev/null +++ b/tests/data/issue33/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/data/issue33/mimetype b/tests/data/issue33/mimetype new file mode 100644 index 00000000..57ef03f2 --- /dev/null +++ b/tests/data/issue33/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file