Skip to content
Snippets Groups Projects
Select Git revision
  • 9d2c827628be007a0dec1b57798bf644cdb2ea98
  • main default protected
2 results

tests-only-starter-code

  • Clone with SSH
  • Clone with HTTPS
  • Tests-Only Starter Code

    A minimal project to be used as starter code for homework assignments in the 250 section of the CSCE 310 course at UNL.

    Quick Start

    Recursively clone this repository and cd into the root folder:

    $ git clone --recursive git@git.unl.edu:csce-310/tests-only-starter-code.git
    $ cd tests-only-starter-code

    (If you forget --recursive when cloning, you can cd into your clone and run git submodule update --init --recursive instead.)

    Install dependencies:

    $ npm install

    Optionally run the linter and the test suite:

    $ npm run lint
    $ npm run test

    Folders and Files

    The folders and files in the starter code are briefly described below.

    Submodules

    • The Git submodule eslint-config contains the ESLint configuration for the coding style used in the tests-only project.

    General Configuration

    • The file tests-only/.gitignore prevents non-source-code files from being accidentally committed to the repository.

    • The file tests-only/package.json describes the project and its dependencies. It can be edited to customize the inputs and processes used in various software lifecyle tasks like linting, testing, or deploying.

    • The file tests-only/package-lock.json records the exact set of dependencies used to satisfy the requirements in tests-only/package.json. It should not be hand-edited; use commands like npm install or npm uninstall from the tests-only directory to make changes.

    • The folder tests-only/node_modules contains the dependencies installed by npm.

    Code Under Test

    • The file tests-only/src/helloWorld.js is an example of a simple implementation that can be unit tested.

    Test Code

    • The file tests-only/src/helloWorld.test.js demonstrates a Jest unit test.

    Adaptation Checklist

    When adapting this code for a new project, make sure to do at least the following:

    • Change the project name, version number, and description in tests-only/package.json.

    • Rename the folder from tests-only to something descriptive and change the corresponding entries in the outer package.json.

    • Rerun npm install to update package-lock.json based on the above changes.