Skip to content

feat: add student record#29

Merged
tr1sm0s1n merged 1 commit intoKBA-Learning:devfrom
sumimaria:student/student-record
Nov 10, 2025
Merged

feat: add student record#29
tr1sm0s1n merged 1 commit intoKBA-Learning:devfrom
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:31
Copy link
Member

@tr1sm0s1n tr1sm0s1n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tr1sm0s1n tr1sm0s1n merged commit 5694723 into KBA-Learning:dev Nov 10, 2025
8 checks passed
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