Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test js files? #93

Open
jonath92 opened this issue Apr 26, 2021 · 2 comments
Open

How to test js files? #93

jonath92 opened this issue Apr 26, 2021 · 2 comments

Comments

@jonath92
Copy link

I would like to write unit tests for the radio applet I am maintaining which I find very difficult as it is not possible to use standard testing libraries due to the different runtime environment. I have seen that there are some tests for js files in this repo but I don't understand how to use them. I am even not sure if it is even possible to apply this tests to an applet.

Any help in this regard is much appreciated.

@ItzSwirlz
Copy link

Woah. Sorry for just setting this now and uh.... I would suggest using GJS tests and making similar ones for cinnamon. There are a few files here and there throughout cinnamon for JS tests but i would assume just run the test files with /usr/bin/cjs?

@jonath92
Copy link
Author

i would assume just run the test files with /usr/bin/cjs?

Yes, but how? I am referring to the tests in /installed-tests/js of this repository. It is not possible to just pick a file and run the file with cjs, e.g. this command:

cjs testGio.js

gives this error:

(cjs:6763): Cjs-CRITICAL **: 11:59:52.738: JS ERROR: ReferenceError: describe is not defined
@testGio.js:15:1

which is not very surprising. I guess I have to somehow call also jasmine.js but I have no idea how. Also maybe I have to do something with the meson.build file? (I never have used meson)

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

No branches or pull requests

2 participants