-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
64 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
informational: true | ||
patch: | ||
default: | ||
informational: true |
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 |
---|---|---|
@@ -1,41 +1,9 @@ | ||
/* eslint-disable max-len */ | ||
'use strict'; | ||
|
||
const { execFileSync } = require('child_process'); | ||
|
||
let opts = { | ||
const opts = { | ||
branches: 80, | ||
lines: 80, | ||
functions: 80, | ||
statements: 80, | ||
}; | ||
|
||
// Only generate coverage report for changed files in PR | ||
// see: https://github.com/actions/checkout/issues/438#issuecomment-1446882066 | ||
// https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | ||
if (process.env.GITHUB_BASE_REF !== undefined) { | ||
console.log('Generating coverage report for changed files...'); | ||
try { | ||
const baseRef = execFileSync('git', [ | ||
'rev-parse', | ||
`origin/${process.env.GITHUB_BASE_REF}`, | ||
]) | ||
.toString() | ||
.replace('\n', ''); | ||
const headRef = process.env.GITHUB_SHA; | ||
const stdout = execFileSync('git', [ | ||
'diff', | ||
'--name-only', | ||
`${baseRef}..${headRef}`, | ||
]).toString(); | ||
opts = { | ||
...opts, | ||
include: stdout.split('\n'), | ||
}; | ||
} catch (error) { | ||
console.log('Error: ', error); | ||
} | ||
} | ||
|
||
console.log('nyc config: ', opts); | ||
module.exports = opts; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
|
||
const handleMessage = require('../src/proxy/routes').handleMessage; | ||
const chai = require('chai'); | ||
|
||
const expect = chai.expect; | ||
|
||
// Use this test as a template | ||
describe('proxy error messages', async () => { | ||
|
||
it('should handle short messages', async function () { | ||
const res = await handleMessage('one'); | ||
expect(res).to.contain('one'); | ||
}); | ||
|
||
it('should handle emoji messages', async function () { | ||
const res = await handleMessage('❌ push failed: too many errors'); | ||
expect(res).to.contain('❌'); | ||
}); | ||
}); |