-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure table is generated correctly (#24)
- Loading branch information
Showing
7 changed files
with
126 additions
and
19 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,31 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ContentFiles Add's new contributor 1`] = ` | ||
"# TestContentFIles | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors) | ||
A test for content files generation | ||
### Content | ||
1. Stuff here | ||
2. Yeah boy | ||
## Contributors | ||
Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)): | ||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
| [<img src=\\"https://avatars2.githubusercontent.com/u/3534236?v=4\\" width=\\"100px;\\"/><br /><sub><b>Jake Bolam</b></sub>](https://jakebolam.com)<br />[💻](#code-jakebolam \\"Code\\") [🤔](#ideas-jakebolam \\"Ideas, Planning, & Feedback\\") [🚇](#infra-jakebolam \\"Infrastructure (Hosting, Build-Tools, etc)\\") [⚠️](#test-jakebolam \\"Tests\\") | [<img src=\\"https://avatars2.githubusercontent.com/u/7265547?v=4\\" width=\\"100px;\\"/><br /><sub><b>tbenning</b></sub>](https://github.com/tbenning)<br />[🎨](#design-tbenning \\"Design\\") | | ||
| :---: | :---: | | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome | ||
## LICENSE | ||
[MIT](LICENSE) | ||
" | ||
`; |
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,52 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const ContentFiles = require('../../src/ContentFiles') | ||
|
||
describe('ContentFiles', () => { | ||
const mockRepository = {} | ||
const mockTestFileContent = fs.readFileSync( | ||
path.join(__dirname, 'test-readme-file.md'), | ||
'utf8', | ||
) | ||
|
||
test(`Add's new contributor`, async () => { | ||
const contentFiles = new ContentFiles({ | ||
repository: mockRepository, | ||
}) | ||
contentFiles.contentFilesByPath = { | ||
'README.md': { | ||
content: mockTestFileContent, | ||
}, | ||
} | ||
|
||
const mockOptionsConfig = { | ||
get: function() { | ||
return { | ||
contributorsPerLine: 7, | ||
contributors: [ | ||
{ | ||
login: 'jakebolam', | ||
name: 'Jake Bolam', | ||
avatar_url: | ||
'https://avatars2.githubusercontent.com/u/3534236?v=4', | ||
profile: 'https://jakebolam.com', | ||
contributions: ['code', 'ideas', 'infra', 'test'], | ||
}, | ||
{ | ||
login: 'tbenning', | ||
name: 'tbenning', | ||
avatar_url: | ||
'https://avatars2.githubusercontent.com/u/7265547?v=4', | ||
profile: 'https://github.com/tbenning', | ||
contributions: ['design'], | ||
}, | ||
], | ||
} | ||
}, | ||
} | ||
await contentFiles.generate(mockOptionsConfig) | ||
|
||
expect(contentFiles.get()['README.md'].content).toMatchSnapshot() | ||
}) | ||
}) |
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,26 @@ | ||
# TestContentFIles | ||
|
||
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors) | ||
|
||
A test for content files generation | ||
|
||
### Content | ||
1. Stuff here | ||
2. Yeah boy | ||
|
||
|
||
## Contributors | ||
|
||
Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)): | ||
|
||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
| [<img src="https://avatars2.githubusercontent.com/u/3534236?v=4" width="100px;"/><br /><sub><b>Jake Bolam</b></sub>](https://jakebolam.com)<br />[💻](https://github.com/all-contribtuors/bot/commits?author=jakebolam "Code") [🤔](#ideas-jakebolam "Ideas, Planning, & Feedback") [🚇](#infra-jakebolam "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/all-contribtuors/bot/commits?author=jakebolam "Tests") | | ||
| :---: | | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
|
||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome | ||
|
||
## LICENSE | ||
|
||
[MIT](LICENSE) |
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