Readme

Here are some tests for val InvocationTracker

Test Cases

  1. Constructor test with valid inputs
    • tests creating a new InvocationTracker instance with valid name and granularity
  2. Constructor test with invalid name
    • verifies that creating an InvocationTracker with an invalid name throws an error
  3. Constructor test existing table
    • verifies that creating an InvocationTracker with an already existing table does not modify that table
  4. Granularity method test
    • checks if the Granularity() method returns the correct initial granularity value
  5. setGranularity method test
    • tests setting a new granularity value and verifies it's updated correctly
  6. increment method test
    • verifies that the increment() method correctly increases the invocation count
  7. InvocationsInSpan method test
    • tests retrieving invocations within a specific time span, including multiple time periods
  8. totalInvocationsInSpan method test
    • checks if the total number of invocations within a given time span is calculated correctly
  9. reset method test
    • verifies that the reset() method clears all recorded invocations
Code
HTTP
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
rozek-invocationtracker_test.web.val.run
Updated: January 29, 2025