-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
17b50a8
commit 3b1b3d2
Showing
20 changed files
with
433 additions
and
799 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
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
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
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 $counter template', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_TEMPLATE: '- $counter $title' | ||
}; | ||
await runAndCompareSnap('Readme.counter.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('Custom template readme generated', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_TEMPLATE: '$newline[$title]($url): $date $description $newline' | ||
}; | ||
await runAndCompareSnap('Readme.custom.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,10 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const {runAndCompareSnap} = require('./testUtils/testUtils'); | ||
describe('Default template readme generated', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...DEFAULT_TEST_ENV | ||
}; | ||
await runAndCompareSnap('Readme.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('Sorting disabled readme', function () { | ||
it('should be equal to the saved snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_DISABLE_SORT: 'true' | ||
}; | ||
await runAndCompareSnap('Readme.sort.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 $emojiKey template', function () { | ||
it('should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_TEMPLATE: '- $emojiKey(💯,🔥)' | ||
}; | ||
await runAndCompareSnap('Readme.emojiKey.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,29 @@ | ||
const {DEFAULT_TEST_ENV} = require('./testUtils/default-env'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const assert = require('assert'); | ||
const {TEST_SNAP_DIR, TEMPLATE, TEST_FILE} = require("./testUtils/testUtils"); | ||
describe('Multiple readme generated via readme_path', function () { | ||
it('should match the snapshots', async function () { | ||
const readme1 = path.join(TEST_SNAP_DIR, 'Readme.multi.1.md'); | ||
const readme2 = path.join(TEST_SNAP_DIR, 'Readme.multi.2.md'); | ||
const envObj = { | ||
...DEFAULT_TEST_ENV, | ||
INPUT_README_PATH: readme1 + ',' + readme2 | ||
}; | ||
process.env = { | ||
...process.env, | ||
...envObj | ||
}; | ||
fs.writeFileSync(readme1, TEMPLATE); | ||
fs.writeFileSync(readme2, TEMPLATE); | ||
const workflow = await require(TEST_FILE); | ||
await workflow.runWorkflow(); | ||
const snapshot1 = fs.readFileSync(readme1 + '.snap', 'utf-8'); | ||
const snapshot2 = fs.readFileSync(readme2 + '.snap', 'utf-8'); | ||
const newReadme1 = fs.readFileSync(readme1, 'utf-8'); | ||
const newReadme2 = fs.readFileSync(readme2, 'utf-8'); | ||
assert.strictEqual(snapshot1, newReadme1); | ||
assert.strictEqual(snapshot2, newReadme2); | ||
}); | ||
}); |
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('Default template readme generated', function () { | ||
it('Generated readme with $randomEmoji template should match the snapshot', async function () { | ||
const envObj = { | ||
...process.env, | ||
...DEFAULT_TEST_ENV, | ||
INPUT_TEMPLATE: '- $randomEmoji(💯,🔥,💫,🚀,🌮)' | ||
}; | ||
await runAndCompareSnap('Readme.randomEmoji.md', envObj); | ||
}); | ||
}); |
Oops, something went wrong.