mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 13:36:29 +00:00
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:
parent
5dbb7213b0
commit
deb6be93f0
5 changed files with 54 additions and 42 deletions
|
@ -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
2
.nvmrc
|
@ -1 +1 @@
|
||||||
12.14.0
|
16.17.0
|
||||||
|
|
|
@ -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 -->
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue