0.1.8 • Published 12 months ago

jest-autograding-reporter v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

jest-autograding-reporter

A Jest test results processor that formats the results for Gradescope (docs) and writes them out to a file results.json, as Gradescope prefers.

Usage

npm install --save-dev jest-autograding-reporter

In your jest.config.js, add the global teardown to clean up the temp file:

globalTearDown: "jest-autograding-reporter/teardown.js"

In the test file, add the weights:

const w = require('jest-autograding-reporter').weight

// a test that's worth 3 autograder points
test(w(3, "some test"), () => {
  // ...
})

To run the autograder:

jest --testResultsProcessor jest-autograding-reporter

You probably only want to use this when you're running in Gradescope, or testing the autograder locally, but if you wanted it for all your test runs, you can add it to jest.config.js.

Caveats and wonkiness

  • Uses the test names to store the weights; test names have to be unique
  • Check that the total points matches your total autograder points in Gradescope
  • Because Jest does not use the require cache, this stores the weights in a temporary file, which it attempts to clean up using the teardown function.
0.1.8

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago