refactor: add tbody to contributors table (#307)

* refactor: add tbody to contributors table

* chore(node): bump version to lts

* fix(html): add correct indentation

* test(url): fix bind error message

Co-authored-by: Pierre Huyghe <phuyghe.externe@bedrockstreaming.com>
This commit is contained in:
Pierre Huyghe 2022-09-07 10:19:41 +02:00 committed by GitHub
parent 5dbb7213b0
commit deb6be93f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 42 deletions

View file

@ -2,7 +2,7 @@ version: 2.1
docker_defaults: &docker_defaults docker_defaults: &docker_defaults
docker: docker:
- image: circleci/node:12.14.0 - image: cimg/node:16.17.0
commands: commands:
prep_env: prep_env:

2
.nvmrc
View file

@ -1 +1 @@
12.14.0 16.17.0

View file

@ -11,11 +11,13 @@ These people contributed to the project:
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable --> <!-- markdownlint-disable -->
<table> <table>
<tbody>
<tr> <tr>
<td align=\\"center\\">Kent C. Dodds is awesome!</td> <td align=\\"center\\">Kent C. Dodds is awesome!</td>
<td align=\\"center\\">Divjot Singh is awesome!</td> <td align=\\"center\\">Divjot Singh is awesome!</td>
<td align=\\"center\\">Jeroen Engels is awesome!</td> <td align=\\"center\\">Jeroen Engels is awesome!</td>
</tr> </tr>
</tobdy>
</table> </table>
<!-- markdownlint-restore --> <!-- markdownlint-restore -->
@ -37,6 +39,7 @@ These people contributed to the project:
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-disable --> <!-- markdownlint-disable -->
<table> <table>
<tbody>
<tr> <tr>
<td align=\\"center\\">Kent C. Dodds is awesome!</td> <td align=\\"center\\">Kent C. Dodds is awesome!</td>
<td align=\\"center\\">Kent C. Dodds is awesome!</td> <td align=\\"center\\">Kent C. Dodds is awesome!</td>
@ -48,6 +51,7 @@ These people contributed to the project:
<td align=\\"center\\">Kent C. Dodds is awesome!</td> <td align=\\"center\\">Kent C. Dodds is awesome!</td>
<td align=\\"center\\">Kent C. Dodds is awesome!</td> <td align=\\"center\\">Kent C. Dodds is awesome!</td>
</tr> </tr>
</tobdy>
</table> </table>
<!-- markdownlint-restore --> <!-- markdownlint-restore -->

View file

@ -57,7 +57,7 @@ function generateContributorsList(options, contributors) {
_.map(formatLine), _.map(formatLine),
_.join('\n </tr>\n <tr>\n '), _.join('\n </tr>\n <tr>\n '),
newContent => { newContent => {
return `\n<table>\n <tr>\n ${newContent}\n </tr>\n</table>\n\n` return `\n<table>\n <tbody>\n <tr>\n ${newContent}\n </tr>\n </tobdy>\n</table>\n\n`
}, },
)(contributors) )(contributors)
} }

View file

@ -1,4 +1,4 @@
import url from '../url'; import url from '../url'
test(`Result of protocol validation should be true`, () => { test(`Result of protocol validation should be true`, () => {
expect(url.isHttpProtocol('http:')).toBe(true) expect(url.isHttpProtocol('http:')).toBe(true)
@ -14,7 +14,11 @@ test(`Result of url validation should be true`, () => {
}) })
test(`Result of url validation should be false when url uses wrong protocol`, () => { test(`Result of url validation should be false when url uses wrong protocol`, () => {
expect(url.isValidHttpUrl('git://git@github.com:all-contributors/all-contributors-cli.git')).toBe(false) expect(
url.isValidHttpUrl(
'git://git@github.com:all-contributors/all-contributors-cli.git',
),
).toBe(false)
}) })
test(`Result of url validation should be false when input isn't url`, () => { test(`Result of url validation should be false when input isn't url`, () => {
@ -35,15 +39,19 @@ test(`Result of parsed url without protocol should be equal`, () => {
test(`Throw an error when parsed input isn't a string`, () => { test(`Throw an error when parsed input isn't a string`, () => {
const input = 123 const input = 123
expect(url.parseHttpUrl.bind(null, input)).toThrowError('input must be a string') expect(url.parseHttpUrl.bind(null, input)).toThrowError(
'input must be a string',
)
}) })
test(`Throw an error when parsed url has wrong protocol`, () => { test(`Throw an error when parsed url has wrong protocol`, () => {
const input = 'ftp://domain.xyz' const input = 'ftp://domain.xyz'
expect(url.parseHttpUrl.bind(null, input)).toThrowError('Provided URL has an invalid protocol') expect(url.parseHttpUrl.bind(null, input)).toThrowError(
'Provided URL has an invalid protocol',
)
}) })
test(`Throw an error when parsed input isn't a URL`, () => { test(`Throw an error when parsed input isn't a URL`, () => {
const input = 'some string' const input = 'some string'
expect(url.parseHttpUrl.bind(null, input)).toThrowError('Invalid URL: http://some string') expect(url.parseHttpUrl.bind(null, input)).toThrowError('Invalid URL')
}) })