Skip to content

Research and Provide a Demo of Unit Testing for front-end JavaScript code #7152

@roslynwythe

Description

@roslynwythe

Overview

We need to select a strategy and a test framework for running unit tests against the front-end JavaScript code in the HfLA website, so that tests can be run first locally and then ultimately as a Pull Request check, in order to ensure the quality of JavaScript code updates. In this issue several sample unit tests will be developed and will be run locally from the command line.

Action Items

  • Select one of the following JS test frameworks: Jest, Mocha and Jasmine. Consider:
    • widely-used JS test framework suitable for invoking tests against JavaScript code on a Jekyll site
    • Ideally tests could be run either locally or in the context of GitHub PR checkes
  • Provide comments documenting the selection, installation and configuration of the test framework
    • In a new git branch, create a folder under the website root named unittests-JSfrontend
    • In the new folder create several unit tests. Provide comments describing your reasoning for selection of unit tests.
    • Invoke the tests from the command line
    • provide comments documenting the commands for running the tests
    • Submit a pull request, and provide links to the relevant comments that will be useful for reviewers.

Resources/Instructions

https://jasmine.github.io/
[How to Test a GitHub Action with GitHub Actions]

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In progress (actively working)

Relationships

None yet

Development

No branches or pull requests

Issue actions