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: .github/copilot-instructions.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Project Overview
2
2
3
-
This public project, called videomail-client, is a web-based npm package for reuse in any other web applications and also in a separate WordPress plugin, see [videomail-for-ninja-forms](https://github.com/binarykitchen/videomail-for-ninja-forms).
3
+
This public project, called videomail-client, is a web-based npm package for reuse in any other web applications and also in a separate WordPress plugin, see (videomail-for-ninja-forms)[https://github.com/binarykitchen/videomail-for-ninja-forms].
4
4
5
5
The most important consumer of this package is (Videomail)[https://www.videomail.io] itself which heavily relies on this package and resides in another, but private repository. Videomail's goal is to enable Sign Language in emails. Deaf users are our main audience.
6
6
@@ -22,7 +22,7 @@ The root `/README.md` file has further general information for you, the GitHub C
22
22
23
23
- All runs on Node.js, the used version is defined in the `.nvmrc` file. Presently it's v22
24
24
- We do not use React nor any frameworks. All is raw, in Vanilla JavaScript.
25
-
- For video recording, we grab images with the deprecated getUserMedia API, send them through WebSocket streams, using the [websocket-stream package](https://www.npmjs.com/package/websocket-stream) and once the user presses the stop button, the server side which is [Videomail](https://www.videomail.io) itself, compiles these image frames into a video and sends them out within an email. That's the big idea.
25
+
- For video recording, we grab images with the deprecated getUserMedia API, send them through WebSocket streams, using the (websocket-stream package)[https://www.npmjs.com/package/websocket-stream] and once the user presses the stop button, the server side which is (Videomail)[https://www.videomail.io] itself, compiles these image frames into a video and sends them out within an email. That's the big idea.
26
26
- We are aware that the getUserMedia API is deprecated, but we have no time to migrate this to the new MediaDevices API. All still works well, so we can ignore this for now.
27
27
- Most source code is written in TypeScript.
28
28
- Security checks using the audit-ci package are included and configured. Security is important.
@@ -31,7 +31,7 @@ The root `/README.md` file has further general information for you, the GitHub C
31
31
32
32
## Browsers and mobile devices
33
33
34
-
The bare minimum is to support those browsers who support the getUserMedia API. Not the older ones. To check if a browser supports this API, you can use the [caniuse.com](https://caniuse.com/?search=getUserMedia) website.
34
+
The bare minimum is to support those browsers who support the getUserMedia API. Not the older ones. To check if a browser supports this API, you can use the (caniuse.com)[https://caniuse.com/?search=getUserMedia] website.
35
35
36
36
Regarding network issues, we already have mechanisms in place to lower the FPS before encoding these videos on the Videomail server side.
37
37
@@ -69,15 +69,15 @@ But here are the default specs for the main Videomail website itself:
69
69
70
70
### Unit Tests
71
71
72
-
- For unit tests we use the next generation [Vitest](https://vitest.dev/) framework.
72
+
- For unit tests we use the next generation (Vitest)[https://vitest.dev] framework.
73
73
- Vitest was chosen because it is fast, has a great API and is compatible with other testing frameworks like Jest.
74
74
- The unit tests are located in the `__tests__` subdirectory of each source code
75
75
76
76
### Visual Tests
77
77
78
-
For visual tests, we use [Storybook](https://storybook.js.org/). It is configured in the `.storybook` folder. The Storybook is used to visually test components and their states.
78
+
For visual tests, we use (Storybook)[https://storybook.js.org]. It is configured in the `.storybook` folder. The Storybook is used to visually test components and their states.
79
79
80
-
In addition, we also use [Chromatic](https://www.chromatic.com/) to catch any visual differences between git commits.
80
+
In addition, we also use (Chromatic)[https://www.chromatic.com] to catch any visual differences between git commits.
Copy file name to clipboardExpand all lines: .github/prompts/generate-unit-tests-for-selected-file.prompt.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,19 @@ When generating unit tests, please follow these guidelines:
10
10
11
11
1. For the selected file, generate a corresponding test file in the `__tests__` directory using the same name as the source file but ending with `.test.ts`.
12
12
2. If the __tests__ directory does not exist, create it. Or else just generate the test file in the same directory as the source file.
13
-
3. Ensure the test file imports the necessary functions or classes from the source file.
14
-
4. Use the Vitest framework for writing tests.
15
-
5. Write tests that cover the functionality of the source file, including edge cases and error handling.
16
-
6. Honour the global Vitest configuration found in the root folder at `vitest.config.ts`.
17
-
7. There is no need to import Vitest's `expect` or `describe` as they are globally available.
18
-
8. Whenever you generate the unit test code, ensure it produces no TypeError or ESLint errors.
13
+
3. If there are already unit tests presents, please do not override these but amend those you are suggesting in the same describe block.
14
+
4. Ensure the test file imports the necessary functions or classes from the source file.
15
+
5. Use the Vitest framework for writing tests.
16
+
6. Make sure to use the latest features of the Vitest package defined in the package.json
17
+
7. Write tests that cover the functionality of the source file, including edge cases and error handling.
18
+
8. When generating imports, ensure their paths are correct and not broken and that the imports are sorted.
19
+
9. Do not mock any functions or modules. Accept anything the file to be tested imports.
20
+
10. Any values to be tested should be types constants defined in the top parent describe block and reused.
21
+
11. Group unit test cases in subsequent describe blocks based on the subject to be tested.
22
+
- For example, if the function to be tested, returns only false or true, group these in two describe blocks.
23
+
12. Honour the global Vitest configuration found in the root folder at `vitest.config.ts`.
24
+
13. There is no need to import Vitest's `expect` or `describe` as they are globally available.
25
+
14. Whenever you generate the unit test code, ensure it produces no TypeError or ESLint errors.
0 commit comments