Skip to content

How to apply automated unit testing and CI to simple JavaScript project -> Original Source [www.valentinog.com]

License

Notifications You must be signed in to change notification settings

santosrai/getting-start-with-github-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to apply automated unit testing and continuous integration to a simple JavaScript project

What is automated testing?

Automated Testing is that testing where tests are run without human intervention.

What is Continuous Integration?

Continuous Integration is the practice of integration of code change into single codebase countinuously.

Lets make pipeline for software development

  • file changes
  • trigger an automated testing
  • release to production

These can be done by the help of continuous integration.

Lets get into Github actions as CI/CD service

For CI/CD service, there need to be configured with a YAML file which takes:

  • name of the pipeline or workflow
  • list of jobs
  • list of steps for every job

Github search config file under ./github/workflows so lets create javascript.yaml file under ./github/workflows

    name: JavaScript workflow
    on: [push]
    jobs:
      test:
        runs-on: ubuntu-latest
        steps:
        - uses: actions/checkout@v1
        - name: Use Node.js 12.x
          uses: actions/setup-node@v1
          with:
            node-version: "12.x"
        - name: npm install, and test
          run: |
            npm install
            npm test
          env:
            CI: true

Now commmit and push on github.

You will see running job on github Actions Tab.

About

How to apply automated unit testing and CI to simple JavaScript project -> Original Source [www.valentinog.com]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •