You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: js/guide_addingtest.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,8 @@ npm test -- --verbose
40
40
- All test files **must be placed inside the `_tests_` folder of the respective directory**.
41
41
- Follow the naming convention: **`<filename>.test.js`**.
42
42
- 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.
44
45
45
46
### 🔄 Import/Export Conventions
46
47
- The Music Blocks repository **strictly follows `const` for imports and exports**.
@@ -81,7 +82,8 @@ describe('My Function Tests', () => {
81
82
❌ Placing test files **outside**`_tests_` (always keep them inside).
82
83
❌ Using `var` or `let` for imports (always use `const`).
83
84
❌ 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.**
85
87
86
88
## 🚀 Running Specific Tests
87
89
To run a specific test file:
@@ -107,4 +109,5 @@ npm test -- -u
107
109
- Ensure all tests pass before creating a PR.
108
110
- Maintain code readability and add comments where needed.
109
111
- 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