1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

ignore working for simple highlights

This commit is contained in:
Fred Chasen 2016-01-02 23:42:35 -05:00
parent 7cad24b414
commit 1c5e7c03fd
17 changed files with 836 additions and 497 deletions

View file

@ -1,28 +1,39 @@
// var test = require('tape');
var assert = require('assert');
// describe("Create new ePub(/path/to/epub/)", function(t) {
//
// var book = ePub("../books/moby-dick/");
//
// book.opened.then(function(){
// assert.equal( book.url, "../books/moby-dick/OPS/", "book url is passed to new EPUBJS.Book" );
// });
//
// });
var sinon = require('sinon');
var fs = require('fs');
describe('ePub', function() {
var ePub = require('../src/epub');
var server;
before(function(){
var packageContents = fs.readFileSync(__dirname + '/../books/moby-dick/OPS/package.opf', 'utf8');
var tocContents = fs.readFileSync(__dirname + '/../books/moby-dick/OPS/toc.xhtml', 'utf8');
describe('#ePub()', function() {
xit('should save without error', function(done) {
var book = ePub("../books/moby-dick/");
server = sinon.fakeServer.create();
server.autoRespond = true;
book.opened.then(function(){
assert.equal( book.url, "../books/moby-dick/OPS/", "book url is passed to new EPUBJS.Book" );
done();
});
server.respondWith("moby-dick/OPS/package.opf", [200, {
"Content-Type": "text/xml"
}, packageContents]);
server.respondWith("moby-dick/OPS/toc.xhtml", [200, {
"Content-Type": "application/xhtml+xml"
}, tocContents]);
});
after(function(){
server.restore();
});
it('should open a epub', function(done) {
var book = ePub("moby-dick/OPS/package.opf");
book.opened.then(function(){
assert.equal( book.isOpen, true, "book is opened" );
assert.equal( book.url, "moby-dick/OPS/package.opf", "book url is passed to new Book" );
done();
});
});
});