Readme
Here are some tests for val InvocationTracker
- Constructor test with valid inputs
- tests creating a new InvocationTracker instance with valid name and granularity
- Constructor test with invalid name
- verifies that creating an InvocationTracker with an invalid name throws an error
- Constructor test existing table
- verifies that creating an InvocationTracker with an already existing table does not modify that table
Granularity
method test- checks if the Granularity() method returns the correct initial granularity value
setGranularity
method test- tests setting a new granularity value and verifies it's updated correctly
increment
method test- verifies that the increment() method correctly increases the invocation count
InvocationsInSpan
method test- tests retrieving invocations within a specific time span, including multiple time periods
totalInvocationsInSpan
method test- checks if the total number of invocations within a given time span is calculated correctly
reset
method test- verifies that the reset() method clears all recorded invocations
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