Skip to content

Commit

Permalink
Swap branch and functions (typo) (#28)
Browse files Browse the repository at this point in the history
* bump packages

* swap branch and functions

* bump eslint-import-resolver-typescript

* 1.0.15
  • Loading branch information
MishaKav authored Sep 10, 2022
1 parent c90619d commit e496e38
Show file tree
Hide file tree
Showing 7 changed files with 1,297 additions and 1,172 deletions.
6 changes: 3 additions & 3 deletions __tests__/multi-files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('multi report', () => {
test('should generate markdown for one file', () => {
const html = `| Title | Lines | Statements | Branches | Functions |
| ----- | ----- | ------- | -------- | -------- |
| title1 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 78%" src="https://img.shields.io/badge/undefined-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 33.33% (2/6) | 100% (0/0) |
| title1 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 78%" src="https://img.shields.io/badge/undefined-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 100% (0/0) | 33.33% (2/6) |
`
// @ts-ignore
const result = getMultipleReport({
Expand All @@ -81,8 +81,8 @@ describe('multi report', () => {
test('should generate markdown for two files', () => {
const html = `| Title | Lines | Statements | Branches | Functions |
| ----- | ----- | ------- | -------- | -------- |
| title1 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 78%" src="https://img.shields.io/badge/undefined-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 33.33% (2/6) | 100% (0/0) |
| title2 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 79%" src="https://img.shields.io/badge/undefined-79%25-yellow.svg" /></a><br/> | 77.27% (34/44) | 33.33% (2/6) | 100% (0/0) |
| title1 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 78%" src="https://img.shields.io/badge/undefined-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 100% (0/0) | 33.33% (2/6) |
| title2 | <a href="https://github.com/undefined/blob/undefined/README.md"><img alt="undefined: 79%" src="https://img.shields.io/badge/undefined-79%25-yellow.svg" /></a><br/> | 77.27% (34/44) | 100% (0/0) | 33.33% (2/6) |
`
// @ts-ignore
const result = getMultipleReport({
Expand Down
6 changes: 3 additions & 3 deletions __tests__/summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('parse summary', () => {
test('should return summary report', () => {
const html = `| Lines | Statements | Branches | Functions |
| ----- | ------- | -------- | -------- |
| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 33.33% (2/6) | 100% (0/0) |
| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 100% (0/0) | 33.33% (2/6) |
`

const { summaryHtml, coverage, color } = getSummaryReport(options)
Expand Down Expand Up @@ -128,13 +128,13 @@ describe('summary to markdown', () => {

test('should convert summary to markdown with title', () => {
const parsedSummary = summaryToMarkdown(summary!, options, false)
const result = `| Lines | Statements | Branches | Functions |\n| ----- | ------- | -------- | -------- |\n| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 33.33% (2/6) | 100% (0/0) |\n`
const result = `| Lines | Statements | Branches | Functions |\n| ----- | ------- | -------- | -------- |\n| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 100% (0/0) | 33.33% (2/6) |\n`
expect(parsedSummary).toEqual(result)
})

test('should convert summary to markdown without title', () => {
const parsedSummary = summaryToMarkdown(summary!, options, true)
const result = `| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 33.33% (2/6) | 100% (0/0) |`
const result = `| <a href="https://github.com/MishaKav/jest-coverage-comment/blob/05953710b21d222efa4f4535424a7af367be5a57/README.md"><img alt="Coverage: 78%" src="https://img.shields.io/badge/Coverage-78%25-yellow.svg" /></a><br/> | 76.74% (33/43) | 100% (0/0) | 33.33% (2/6) |`
expect(parsedSummary).toEqual(result)
})
})
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit e496e38

Please sign in to comment.