Skip to content

Run tests on CI server (and locally with npm test) #45

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"globals": {
"dataValues": false,
"module": false,
"util": false,
"wikibase": false
},
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
composer.lock
vendor/
node_modules/

.idea/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_script:

script:
- composer test
- npm install && npm run eslint
- npm install && npm test

notifications:
irc:
Expand Down
44 changes: 44 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = function ( config ) {
config.set( {
frameworks: [ 'qunit' ],

files: [
'node_modules/jquery/dist/jquery.js',

// TODO: install JS dependencies using npm
'vendor/data-values/javascript/lib/util/util.inherit.js',
'vendor/data-values/javascript/src/dataValues.js',
'vendor/data-values/javascript/src/DataValue.js',
'vendor/data-values/javascript/src/values/StringValue.js',
'vendor/data-values/javascript/src/values/UnDeserializableValue.js',
'vendor/wikibase/data-model-javascript/src/__namespace.js',
'vendor/wikibase/data-model-javascript/src/GroupableCollection.js',
'vendor/wikibase/data-model-javascript/src/Group.js',
'vendor/wikibase/data-model-javascript/src/Snak.js',
'vendor/wikibase/data-model-javascript/src/Set.js',
'vendor/wikibase/data-model-javascript/src/List.js',
'vendor/wikibase/data-model-javascript/src/*.js',

'src/__namespace.js',
'src/Serializers/Serializer.js',
'src/Serializers/*.js',
'src/SerializerFactory.js',
'src/StrategyProvider.js',
'src/Deserializers/Deserializer.js',
'src/Deserializers/*.js',
'src/DeserializerFactory.js',
'tests/MockEntity.js',
'tests/MockEntity.tests.js',
'tests/StrategyProvider.tests.js',
'tests/SerializerFactory.tests.js',
'tests/Serializers/*.js',
'tests/Deserializers/*.js',
'tests/DeserializerFactory.tests.js'
],

port: 9876,

logLevel: config.LOG_INFO,
browsers: [ 'PhantomJS' ]
} );
};
35 changes: 33 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
{
"name": "wikibase-serialization",
"description": "JavaScript library containing serializers and deserializers for the Wikibase DataModel.",
"version": "2.1.0",
"contributors": [
{
"name": "H. Snater",
"url": "http://www.snater.com"
},
{
"name": "Adrian Lang",
"email": "adrian.lang@wikimedia.de"
}
],
"repository": {
"type": "git",
"url": "https://github.com/wmde/WikibaseSerializationJavaScript"
},
"license": "GPL-2.0+",
"directories": {
"lib": "src",
"test": "tests"
},
"support": {
"url": "https://phabricator.wikimedia.org/"
},
"dependencies": {
"jquery": "^3.2.1"
},
"devDependencies": {
"eslint": "^3.19.0",
"eslint-config-wikimedia": "0.4.0"
"eslint-config-wikimedia": "0.4.0",
"karma": "^1.7.1",
"karma-cli": "^1.0.1",
"karma-phantomjs-launcher": "^1.0.4",
"karma-qunit": "^1.2.1",
"qunit": "^1.0.0"
},
"scripts": {
"eslint": "eslint ."
"test": "npm run eslint && npm run run-tests",
"eslint": "eslint .",
"run-tests": "karma start --single-run"
}
}
1 change: 1 addition & 0 deletions src/__namespace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @ignore
*/
window.wikibase = window.wikibase || {};
wikibase.serialization = wikibase.serialization || {};