Add unit tests for for AiAssist plugin initialization and …#32
Add unit tests for for AiAssist plugin initialization and …#32
Conversation
…configuration to ensure proper functionality and error handling
|
@me146 I tried running tests on your branch and I did not get "module not found" error, just "Cannot find name" errors. Are you doing something else? Can you provide steps to reproduce? |
…ty in AiAssist tests
…alue in AiAssist configuration
|
Please ensure the following dependencies are added to the project to prevent errors and maintain consistency across all pull requests: This is a common requirement, and including these dependencies in the project setup will avoid the need to include them individually in each pull request. |
jjroelofs
left a comment
There was a problem hiding this comment.
Thx, now I only have one error due to a test failure, please check it out:
(base) jur@jurs-MacBook-Pro ckeditor5-ai-assist % yarn run test
yarn run v1.22.22
warning ../package.json: No license field
$ ckeditor5-package-tools test
Entry file saved in "/Users/jur/www/ckeditor5-ai-assist/tmp/tests-entry-point.js".
START:
Webpack bundling...
asset commons.js 9.24 MiB [emitted] (name: commons) (id hint: commons)
asset runtime.js 8.53 KiB [emitted] (name: runtime)
asset tests-entry-point.3893782553.js 1.04 KiB [emitted] (name: tests-entry-point.3893782553)
Entrypoint tests-entry-point.3893782553 9.25 MiB = runtime.js 8.53 KiB commons.js 9.24 MiB tests-entry-point.3893782553.js 1.04 KiB
ERROR in /Users/jur/www/ckeditor5-ai-assist/tests/aiassist.ts
./tests/aiassist.ts 137:12-17
[tsl] ERROR in /Users/jur/www/ckeditor5-ai-assist/tests/aiassist.ts(137,13)
TS18046: 'error' is of type 'unknown'.
ts-loader-default_aadc0d91f92e8c5c
@ ./tmp/tests-entry-point.js 1:0-62
webpack 5.96.1 compiled with 1 error in 3733 ms
18 11 2024 14:33:31.716:INFO [karma-server]: Karma v6.4.4 server started at http://localhost:9876/
18 11 2024 14:33:31.717:INFO [launcher]: Launching browsers CHROME_LOCAL with concurrency unlimited
18 11 2024 14:33:31.720:INFO [launcher]: Starting browser Chrome
18 11 2024 14:33:32.933:INFO [Chrome 130.0.0.0 (Mac OS 10.15.7)]: Connected on socket G0wql6W5EfXD8jZfAAAB with id 42474583
AiAssist
✔ should be named AiAssist
init()
✔ should load AiAssist
✔ should add an icon to the toolbar
✔ should initialize with default configuration
AiAssist - Successful Initialization Tests
✔ should initialize with provided configuration
AiAssist Configuration
✔ should throw an error if apiKey is not provided
✔ should throw an error if temperature is out of range
✔ should throw an error if maxTokens is out of range
Finished in 0.107 secs / 0.009 secs @ 14:33:33 GMT+0100 (Central European Standard Time)
SUMMARY:
✔ 8 tests completed
✨ Done in 7.67s.
|
@me146 Please pull latest changes and run |
we are having dependency issue or something else, not able to figure out as now I'm getting module not found in augmentation.ts priorer it's working absolutely fine, spent a almost 2-3 hrs on it 🙁😓.