forked from mattallty/jest-github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v1
- Loading branch information
Showing
23 changed files
with
3,855 additions
and
33,700 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
lib/ |
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,40 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
es6: true, | ||
jest: true | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module' | ||
}, | ||
extends: ['eslint:recommended', 'plugin:prettier/recommended'], | ||
overrides: [ | ||
{ | ||
files: ['**/*.ts'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier/@typescript-eslint', | ||
'plugin:jest/recommended' | ||
], | ||
plugins: ['@typescript-eslint', 'jest'], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'warn', | ||
{ | ||
allowExpressions: true | ||
} | ||
], | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'no-console': 'error', | ||
// nededed for mixins to avoid unecessary warnings | ||
'@typescript-eslint/no-empty-interface': 'off' | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
node_modules/ | ||
|
||
jest.results.json | ||
lib/ | ||
|
||
# Editors | ||
.vscode | ||
|
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,2 @@ | ||
dist/ | ||
node_modules/ |
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,6 @@ | ||
module.exports = { | ||
trailingComma: "all", | ||
tabWidth: 2, | ||
semi: false, | ||
printWidth: 90, | ||
} |
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,15 +1,44 @@ | ||
# Jest Github Action | ||
|
||
> Jest action adding checks to your pull requests | ||
Main features: | ||
|
||
- Add status checks with code annotations to your pull requests | ||
- Comment your pull requests with code coverage table (if tests succeeded) | ||
|
||
## Usage | ||
|
||
You can now consume the action by referencing the v1 branch | ||
|
||
```yaml | ||
uses: actions/javascript-action@v1 | ||
uses: mattallty/jest-github-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
### Overriding the test command | ||
By default, this action will execute `npm test` to run your tests. | ||
You can change this behavior by providing a custom `test-command` like this: | ||
|
||
```yaml | ||
uses: mattallty/jest-github-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# this is just an example, this could be any command that will trigger jest | ||
test-command: "yarn test" | ||
``` | ||
|
||
### Running tests only on changed files | ||
|
||
```yaml | ||
uses: mattallty/jest-github-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
milliseconds: 1000 | ||
# Runs tests related to the changes since the base branch of your pull request | ||
# Default to false if not set | ||
changes-only: true | ||
``` | ||
|
||
See the [actions tab](https://github.com/mattallty/jest-github-action/actions) for runs of this action! :rocket: |
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
Oops, something went wrong.