diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-12-22 10:18:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 10:18:38 +0100 |
commit | 194ebc3da9641ff96f083f9d8ab43c2d27944f9a (patch) | |
tree | c50988f32ccf18df93ae7ab40be78e9459642818 /lib/output/modifiers/__tests__/fetchRemoteImages.js | |
parent | 64ccb6b00b4b63fa0e516d4e35351275b34f8c07 (diff) | |
parent | 16af264360e48e8a833e9efa9ab8d194574dbc70 (diff) | |
download | gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.zip gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.tar.gz gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.tar.bz2 |
Merge pull request #1543 from GitbookIO/dream
React for rendering website with plugins
Diffstat (limited to 'lib/output/modifiers/__tests__/fetchRemoteImages.js')
-rw-r--r-- | lib/output/modifiers/__tests__/fetchRemoteImages.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/output/modifiers/__tests__/fetchRemoteImages.js b/lib/output/modifiers/__tests__/fetchRemoteImages.js deleted file mode 100644 index bc1704d..0000000 --- a/lib/output/modifiers/__tests__/fetchRemoteImages.js +++ /dev/null @@ -1,40 +0,0 @@ -var cheerio = require('cheerio'); -var tmp = require('tmp'); -var path = require('path'); - -var URL = 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png'; - -describe('fetchRemoteImages', function() { - var dir; - var fetchRemoteImages = require('../fetchRemoteImages'); - - beforeEach(function() { - dir = tmp.dirSync(); - }); - - it('should download image file', function() { - var $ = cheerio.load('<img src="' + URL + '" />'); - - return fetchRemoteImages(dir.name, 'index.html', $) - .then(function() { - var $img = $('img'); - var src = $img.attr('src'); - - expect(dir.name).toHaveFile(src); - }); - }); - - it('should download image file and replace with relative path', function() { - var $ = cheerio.load('<img src="' + URL + '" />'); - - return fetchRemoteImages(dir.name, 'test/index.html', $) - .then(function() { - var $img = $('img'); - var src = $img.attr('src'); - - expect(dir.name).toHaveFile(path.join('test', src)); - }); - }); -}); - - |