Skip to content

Wraps and install Jest test runner in a github action.

License

Notifications You must be signed in to change notification settings

stefanoeb/jest-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️⚠️⚠️ You don't need this action ⚠️⚠️⚠️

Github Actions have everything that you need to run your jest tests, to do that simply use the run commands like so:

name: CI
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install modules
      run: yarn
    - name: Run tests
      run: yarn test

This action executes Jest test runner without any previous action/build step or Docker required.

Prerequisites

Jest

You must have the Jest running locally for the action to execute. More info on the Jest getting started guide

Usage

Add to your main.yml file or create a new file named .github/workflows/test.yml and add:

name: Tests

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Run Jest
      uses: stefanoeb/[email protected]

You can also pass custom args to jest through the with: parameter:

name: Tests

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Run Jest
      uses: stefanoeb/[email protected]
      with:
        jestArgs: path/to/my.test.js

If there is no previous step installing the necessary modules, this action will execute a yarn install or npm install automatically.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.