Skip to content

API Test and Mocked API Test Coverage info#48

Closed
sotnemfresh wants to merge 3 commits into
tanjaq:mainfrom
sotnemfresh:main
Closed

API Test and Mocked API Test Coverage info#48
sotnemfresh wants to merge 3 commits into
tanjaq:mainfrom
sotnemfresh:main

Conversation

@sotnemfresh
Copy link
Copy Markdown

Test Run Time: 18:02 01.05.2026

PASS validation/validateUsername.test.js
√ return false for empty username (11 ms)
√ return false for username < 6 characters
√ return false for username > 30 characters
√ return true for username > 6 and < 30 characters (1 ms)
√ return false for username that contains unauthorized characters
√ return true for username with authorized characters

PASS validation/validatePassword.test.js
√ return false for empty password (9 ms)
√ return false for password < 8 characters
√ return false for password = 7 characters (1 ms)
√ return true for password = 8 characters
√ return true for password => 8 characters (1 ms)
√ return false for password => 8 characters, no numbers
√ return false for password => 8 characters, no lowercase
√ return false for password => 8 characters, no uppercase
√ return false for password => 8 characters, no letters (1 ms)
√ return false for password with special characters
√ return false for password with special characters and underscore

PASS ./app.mock.test.js
given correct username and password
√ return status 200 (34 ms)
√ returns userId (4 ms)
√ returns correct message (2 ms)
√ content-type is json (3 ms)
√ userId has correct value (4 ms)
given incorrect or missing username and password
√ return status 400 (2 ms)
√ returns error message (3 ms)
√ does NOT return userId (2 ms)
√ missing username returns 400 (3 ms)
√ missing password returns 400 (3 ms)
√ missing email returns 400 (coverage for validateEmail) (2 ms)
√ email is not a string returns 400 (2 ms)

PASS validation/validateEmail.test.js (10.545 s)
√ return false for empty email (2010 ms)
√ return false for missing @ (2000 ms)
√ return false for missing domain (2000 ms)
√ return true for simple valid email (2000 ms)
√ return true for email with subdomain (2000 ms)

PASS ./app.test.js (24.894 s)
given correct username and password
√ return status 200 (2034 ms)
√ returns userId (2004 ms)
√ returns correct message (2003 ms)
√ content-type is json (2003 ms)
√ userId has correct value (2003 ms)
given incorrect or missing username and password
√ return status 400 (2003 ms)
√ returns error message (2003 ms)
√ does NOT return userId (2003 ms)
√ missing username returns 400 (2003 ms)
√ missing password returns 400 (2003 ms)
√ missing email returns 400 (coverage for validateEmail) (2003 ms)
√ email is not a string returns 400 (2001 ms)

Test Suites: 5 passed, 5 total
Tests: 46 passed, 46 total
Snapshots: 0 total
Time: 29.318 s
Ran all test suites.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

API & Mocked Tests and Coverage

Purpose: Validate README requirements for regular tests, mocked email tests, coverage, and runtime comparison.
Status: ✅ PASS
Regular tests (app.test.js): ✅ PASS (25399ms)
Mocked tests (app.mock.test.js): ✅ PASS (1230ms)
Coverage gate (both runs at 100%): ✅ PASS
Runtime gate (regular ≥ mocked + 1500ms): ✅ PASS
Regular coverage (app.js): lines=100% | statements=100% | functions=100% | branches=100%
Mocked coverage (app.js only): lines=100% | statements=100% | functions=100% | branches=100%
Run details: https://github.com/tanjaq/User-Register/actions/runs/25219430320
PR checks: https://github.com/tanjaq/User-Register/pull/48/checks

@tanjaq tanjaq closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants