Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/betrybe/jest-evaluator-action
🛼 Jest evaluator Action for Tryber projects
https://github.com/betrybe/jest-evaluator-action
github-actions javascript jest test-automation
Last synced: about 1 month ago
JSON representation
🛼 Jest evaluator Action for Tryber projects
- Host: GitHub
- URL: https://github.com/betrybe/jest-evaluator-action
- Owner: betrybe
- Created: 2020-01-13T18:58:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-19T16:00:52.000Z (11 months ago)
- Last Synced: 2024-10-27T13:28:48.252Z (2 months ago)
- Topics: github-actions, javascript, jest, test-automation
- Language: JavaScript
- Homepage:
- Size: 107 KB
- Stars: 1
- Watchers: 40
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jest-evaluator-action
Jest evaluator action for Tryber projectsThis action evaluate Tryber projects with [Jest](https://jestjs.io/) library.
**WARNING:** the image docker version specified in the `action.yml` must be the same as the last evaluator release version
## Inputs
- `npm-start`
Optional
Run npm start and waits to url before testing.
- `wait-for`
Optional
Url that npm start command waits for
- `pr_author_username`
**Required**
Pull Request author username.
## Outputs
- `result`
Jest unit tests JSON results in base64 format.
## Usage example
```yml
- uses: betrybe/jest-evaluator-action@v8
with:
pr_author_username: ${{ github.event.inputs.pr_author_username }}
with:
npm-start: true # false is default
wait-for: 'http://localhost:8080' # http://localhost:3000 is default
```## How to get result output
```yml
- name: Jest evaluator
id: evaluator
uses: betrybe/jest-evaluator-action@v8
with:
pr_author_username: ${{ github.event.inputs.pr_author_username }}
- name: Next step
uses: another-github-action
with:
param: ${{ steps.evaluator.outputs.result }}
```## Project contraints
The project that want to use this action should implement unit tests grouping them using `describe` statements.
Each `describe` statement will be mapped to a requirement.Example:
```javascript
describe('requirement #1' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});describe('requirement #2' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});describe('requirement #3' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});
```Project repository must create a file called `requirements.json` inside `.trybe` folder.
This file should have the following structure:
```json
{
"requirements": [{
"description": "requirement #1",
"bonus": false
}, {
"description": "requirement #2",
"bonus": true
}, {
"description": "requirement #3",
"bonus": false
}]
}
```where the `"requirement #1"`, `"requirement #2"` and `"requirement #3"` are the requirements and describes names.
## Learn about GitHub Actions
- https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-a-docker-container-action