mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-02 20:59:18 +00:00
Replace karma with jsdom + mocha + chai
* Also a bit refactoring for better testability
This commit is contained in:
20
src/js/utils/renderer.js
Normal file
20
src/js/utils/renderer.js
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
export function render(repository, commits) {
|
||||
const $commits = commits.map(commit => {
|
||||
return `
|
||||
<li>
|
||||
<span>${commit.message.replace(/\n/g, '<br />')}<span>
|
||||
<br /><br />
|
||||
<small>${commit.committer.name}</small>
|
||||
</li>`;
|
||||
});
|
||||
|
||||
return `
|
||||
<h1>${repository.description}</h1>
|
||||
<h2>
|
||||
<a href="${repository.html_url}">${repository.full_name}</a>
|
||||
</h2>
|
||||
<ul>${$commits.join('')}</ul>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user