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

Add KARMA test suite to enable testing #22

Merged
merged 5 commits into from Mar 26, 2022
Merged

Conversation

stockiNail
Copy link
Contributor

@stockiNail stockiNail commented Mar 26, 2022

This PR is adding test suite in order to enable the tests.

The source was chartjs-plugin-annotation and maybe something is not "perfect".

What cannot do is to register the plugin globally (try in several ways without any success) therefore in this PR the plugin has been adding in the first test case.

EDIT: the global registration was fixed putting it in beforeAll hook. Thanks @kurkle

@stockiNail
Copy link
Contributor Author

What cannot do is to register the plugin globally (try in several ways without any success) therefore in this PR the plugin has been adding in the first test case.

I had a look to chartjs-plugin-datalabels which, like this plugin, doesn't have the auto registration. Nevertheless I wasn't able to enable it globally. :(

@kurkle
Copy link
Owner

kurkle commented Mar 26, 2022

Oh, how nice! Than you!

@kurkle
Copy link
Owner

kurkle commented Mar 26, 2022

What cannot do is to register the plugin globally (try in several ways without any success) therefore in this PR the plugin has been adding in the first test case.

I had a look to chartjs-plugin-datalabels which, like this plugin, doesn't have the auto registration. Nevertheless I wasn't able to enable it globally. :(

Did you try adding a beforeAll handler in test/index.js?

@stockiNail
Copy link
Contributor Author

Oh, how nice! Than you!

ur welcome! I wanted to understand how it works ;)

@stockiNail
Copy link
Contributor Author

Did you try adding a beforeAll handler in test/index.js?

No... only in beforeEach. Let me try

@stockiNail
Copy link
Contributor Author

Did you try adding a beforeAll handler in test/index.js?

And as usual you are right! ;) Fixed!

@sonarcloud
Copy link

sonarcloud bot commented Mar 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kurkle kurkle merged commit 71d5ae5 into kurkle:master Mar 26, 2022
@stockiNail stockiNail deleted the karma branch March 26, 2022 18:06
@stockiNail
Copy link
Contributor Author

@kurkle I'm going to add some test cases because I'll have a couple of PR and I want to make sure do not destroy anything!

@kurkle
Copy link
Owner

kurkle commented Mar 26, 2022

@kurkle I'm going to add some test cases because I'll have a couple of PR and I want to make sure do not destroy anything!

I tweaked the CI to do coverage analysis on sonar cloud too (and removed windows runner, because I don't know how to do coverage on multiple osses and its slow etc)

So, the quality gate is failing currently because test coverage is too low.. looking forward on your new test cases to fix that! :)

@stockiNail
Copy link
Contributor Author

I'm doing... I have added chartjs-adapter-luxon and luxon as dependencies in order to test also the time axis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants