Skip to content

Added ability to run tests in karma #69

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

Merged
merged 6 commits into from
May 17, 2017
Merged

Added ability to run tests in karma #69

merged 6 commits into from
May 17, 2017

Conversation

bekh6ex
Copy link
Contributor

@bekh6ex bekh6ex commented May 15, 2017

As soon as code in this repository doesn't depend on the Core, we are able to run tests independently.
With this PR you can just do npm install && npm test and that's it!

@bekh6ex bekh6ex requested a review from thiemowmde May 15, 2017 14:50
@bekh6ex bekh6ex self-assigned this May 15, 2017
Copy link
Member

@manicki manicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My JavaScript skills are probably as bad as my German skills, so I'd let @thiemowmde and @JonasKress say something more relevant here.

From what I can see test are run on Travis, so I am happy. Travis build script etc could probably be improved but this is something for another pull request. Thanks for your effort!

package.json Outdated
"author": { "name" : "H. Snater", "url" : "http://www.snater.com"},
"contributors":[
{ "name" : "H. Snater", "url" : "http://www.snater.com"},
{ "name" : "Adrian Lang", "email" : "adrian.lang@wikimedia.de"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it makes sense to include this email address when Adrian is no longer working for WMDE. Is it OK to only have a "name" here?

For probably more important part: I guess would be better to "title" Adrian as "Adrian Heine".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just copied it from composer.json. Personally, don't care. 😄

@@ -1,4 +1,5 @@
/**
* @ignore
*/
wikibase.datamodel = wikibase.datamodel || {};
window.wikibase = window.wikibase || {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could some JS wizard explain what is the different before the code before and after? Would both work in all cases? What "normal" browsers do different so that it apparently was not an issue before.

This comment is not mean as anything against this particular PR. I just don't understand intricacies of Java Script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails on NodeJS because wikibase variable is not defined and it tries to access it.
But having more full explanation would be nice.

Copy link
Contributor Author

@bekh6ex bekh6ex May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understood it might be PhantomJS "feature", but any way new code should work just fine.

'vendor/data-values/javascript/src/dataValues.js',
'vendor/data-values/javascript/src/*.js',
'vendor/data-values/javascript/src/values/*.js',
'src/*.js',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is automatically generated right? Seems a bit odd to have some/all files listed individually and then use the wildcard for, at least partly, the same stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 Seems reasonable to expect that it is generated automatically, but no.
I did it by hand.
Basically, I was adding needed files before 'src/*.js' until there were no errors. May be we can generate it, who knows...

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

Successfully merging this pull request may close these issues.

3 participants