-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d14032
commit ca8c826
Showing
12 changed files
with
113 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with categories template', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080', | ||
INPUT_TEMPLATE: '$categories', | ||
INPUT_CATEGORIES_TEMPLATE: '$category<br/>' | ||
}; | ||
await runAndCompareSnap('Readme.categories.template.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with categories names', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080', | ||
INPUT_TEMPLATE: '$categories', | ||
}; | ||
await runAndCompareSnap('Readme.categories.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with remove duplicates flag', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080/duplicates', | ||
INPUT_REMOVE_DUPLICATES: 'true' | ||
}; | ||
await runAndCompareSnap('Readme.removeDuplicates.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with feed names', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080,http://localhost:8080,http://localhost:8080', | ||
INPUT_FEED_NAMES: 'hello,,world', | ||
INPUT_TEMPLATE: '$newline - $feedName -> $title ', | ||
INPUT_MAX_POST_COUNT: '100', | ||
}; | ||
await runAndCompareSnap('Readme.feedNames.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with advanced manipulation via JS', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_ITEM_EXEC: 'post.title=post.title.replace("Gautam",""); post.title=post.title.replace("browser","");' | ||
}; | ||
await runAndCompareSnap('Readme.exec.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Readme generated after retry', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080/failtest', | ||
INPUT_RETRY_COUNT: '5' | ||
}; | ||
await runAndCompareSnap('Readme.retry.md', envObj); | ||
}).timeout(20 * 1000); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with truncated description', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_DESCRIPTION_MAX_LENGTH: '10', | ||
INPUT_TEMPLATE: '$description $newline' | ||
}; | ||
await runAndCompareSnap('Readme.truncate.description.md', envObj); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const assert = require('assert'); | ||
const {escapeHTML} = require("../src/utils"); | ||
describe('Unit Tests', function () { | ||
it('escapeHTML should work as expected', function () { | ||
assert.strictEqual(escapeHTML('<hello>()\'"'), '<hello>()'"'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Generated readme with no validation flag', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_FEED_LIST: 'http://localhost:8080/empty-tags', | ||
INPUT_DISABLE_ITEM_VALIDATION: 'true' | ||
}; | ||
await runAndCompareSnap('Readme.emptyTags.md', envObj); | ||
}); | ||
}); |