Skip to content

Commit 06cf3a2

Browse files
authored
Add e2e test for bySiteStructure filename generator (#170)
1 parent 40043ba commit 06cf3a2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/e2e/e2e-test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,23 @@ describe('E2E', function() {
2020

2121
urls.forEach(function(url) {
2222
describe(url, function() {
23-
it('should be successfully scraped', function() {
23+
it('should be successfully scraped with byType filename generator', function() {
2424
var scraperOptions = _.clone(options);
2525
var hostname = URL.parse(url).hostname;
26-
scraperOptions.directory = resultDirname + '/' + hostname;
26+
scraperOptions.directory = resultDirname + '/' + hostname + '-byType';
2727
scraperOptions.urls = [ { url: url, filename: 'index.html' } ];
28+
scraperOptions.filenameGenerator = 'byType';
29+
return scraper.scrape(scraperOptions).then(function(result) {
30+
result.should.be.ok();
31+
});
32+
});
33+
34+
it('should be successfully scraped with bySiteStructure filename generator', function() {
35+
var scraperOptions = _.clone(options);
36+
var hostname = URL.parse(url).hostname;
37+
scraperOptions.directory = resultDirname + '/' + hostname + '-bySiteStructure';
38+
scraperOptions.urls = [ { url: url } ];
39+
scraperOptions.filenameGenerator = 'bySiteStructure';
2840
return scraper.scrape(scraperOptions).then(function(result) {
2941
result.should.be.ok();
3042
});

0 commit comments

Comments
 (0)