Skip to content

Commit 03a81a9

Browse files
authored
Adding some more points to guide (#4554)
1 parent 68a0be9 commit 03a81a9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

js/guide_addingtest.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ npm test -- --verbose
4040
- All test files **must be placed inside the `_tests_` folder of the respective directory**.
4141
- Follow the naming convention: **`<filename>.test.js`**.
4242
- Ensure **100% function coverage** when adding tests.
43-
- **Mock dependencies** where necessary to isolate unit tests.
43+
- **Mock dependencies** where necessary to isolate unit tests.
44+
- **Whenever a function is added or its functionality is changed, ensure that the corresponding test cases are added, updated, or refactored.** This ensures that the test suite remains accurate and reliable.
4445

4546
### 🔄 Import/Export Conventions
4647
- The Music Blocks repository **strictly follows `const` for imports and exports**.
@@ -81,7 +82,8 @@ describe('My Function Tests', () => {
8182
❌ Placing test files **outside** `_tests_` (always keep them inside).
8283
❌ Using `var` or `let` for imports (always use `const`).
8384
❌ Forgetting to mock dependencies when needed.
84-
❌ Not handling async tests properly (use `async/await` or `done`).
85+
❌ Not handling async tests properly (use `async/await` or `done`).
86+
**Neglecting to update or refactor test cases when adding or modifying functions.**
8587

8688
## 🚀 Running Specific Tests
8789
To run a specific test file:
@@ -107,4 +109,5 @@ npm test -- -u
107109
- Ensure all tests pass before creating a PR.
108110
- Maintain code readability and add comments where needed.
109111
- Adhere to the **import/export conventions** stated above.
110-
- **Do not merge** without proper test coverage.
112+
- **Do not merge** without proper test coverage.
113+
- **Always update or refactor test cases when adding or modifying functions to ensure the test suite remains accurate and reliable.**

0 commit comments

Comments
 (0)