Skip to content

feat: add student record#22

Closed
sumimaria wants to merge 1 commit intoKBA-Learning:mainfrom
sumimaria:student/student-record
Closed

feat: add student record#22
sumimaria wants to merge 1 commit intoKBA-Learning:mainfrom
sumimaria:student/student-record

Conversation

@sumimaria
Copy link

@sumimaria sumimaria commented Nov 10, 2025

📝 Description

This PR adds a new Student class that models a student's marks and provides utility methods:

  • total() – calculates the total marks across all subjects
  • passed() – checks whether the student has passed all subjects (marks ≥ 40)

It also includes a dedicated test file (student.test.js) using Node’s built-in testing framework (node:test) and strict assertions to validate functionality.


🔗 Related Issue

Fixes #
(e.g., Fixes #7 — Add basic Student class with test coverage)


🧩 Type of Change

  • ✨ New feature — added a Student class with methods
  • ✅ Test addition — introduced test cases using Node’s built-in test module
  • 🧾 Documentation update
  • 🧹 Code refactoring
  • 🐞 Bug fix
  • ⚡ Performance improvement

🧠 Changes Made

  • Added student.js with the Student class
    • total() → returns sum of marks using reduce()
    • passed() → returns true only if all marks ≥ 40 using every()
  • Added student.test.js for automated testing
    • Tests for total marks calculation
    • Tests for pass/fail conditions
  • Ensured ES module compatibility via export/import

🧪 Testing

How to Run Tests

  1. Ensure Node.js ≥ v18 is installed.
  2. Run the test command:
    node --test student.test.js

@sumimaria sumimaria requested a review from tr1sm0s1n as a code owner November 10, 2025 09:18
@tr1sm0s1n
Copy link
Member

No PR to main.

@tr1sm0s1n tr1sm0s1n closed this Nov 10, 2025
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.

Student Record

2 participants