/bcontr-js

A small library to run unit-test-driven student assignments in a browser environment.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

🥓 bcontr.js 🥓

Browser CONsole Test Runner, or BCONTR.

Pronounced “Baconator”, written bcontr or bcontr.js.

Introduction

bcontr.js is a small library for use by code educators to allow them to write a specific kind of assignment, one that:

  1. is unit-test-driven, to give learners fast feedback on whether their code meets requirements
  2. is runnable in a browser to avoid complex terminal setups for new coders
  3. welcomes learners with easy-to-parse test failures

Current Status

We are currently at version 0.2, so the API is still unstable, and we have plans to significantly overhaul it.

However, the proof of concept is there. It works and it is glorious.

Usage

This section will be expanded once the API has settled down. For now, feel free to check out the example assignment to see how it can be used.

Basic Setup

Include This Library

Include the following tag in the <head> tag of your HTML file:

<script src="https://cdn.jsdelivr.net/gh/abbreviatedman/bcontr-js@0.2.0/index.js"></script>
Write Tests

Write tests in a separate JavaScript file. Load that file after bcontr.js.

See the example assignment to see an example of how to load it in, as well as what these tests could look like.

Contributing

We welcome new contributors!

If you want to contribute, please have some experience using the test runner with an assignment. The example bcontr.js assignment repo is a helpful resource for testing the current release.

bcontr.js is released under the GPL v3 license. Your contributions will be as well.

If you’d like to contribute:

  1. Submit an issue with a feature request or potential bug so it can be discussed. This ensures your work fits a need and the project’s vision.
  2. Let us know in this discussion that you’d like to contribute to the issue.
  3. If approved, work in your fork of the repository.
  4. Once your draft is complete, open a pull request to the development branch.
  5. Take part in the discussion before the pull request is merged—if your contribution needs feedback and revision, that discussion will happen in the pull request comments.
  6. Be patient—once your contribution is merged into the development branch, it should soon make its way into a new release via the main branch.
  7. Once your contribution is part of the project: celebrate! Well done.