Skip to content

Update the CI build #124

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 4 commits into from
Oct 3, 2017
Merged
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
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
lib/jquery/**
lib/qunit/**
lib/qunit.parameterize/**
lib/require/**
node_modules/**
vendor/**
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ language: php
php:
- 5.5

env:
- RUNJOB=eslint
- RUNJOB=qunit

before_script:
- nvm install 4
- npm install
- composer install

script: bash ./build/travis/script.sh
script:
- npm test
- composer test

notifications:
irc:
Expand Down
55 changes: 4 additions & 51 deletions DataValuesJavaScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
require_once __DIR__ . '/vendor/autoload.php';
}

if ( !defined( 'MEDIAWIKI' ) ) {
return 1;
}

$GLOBALS['wgExtensionCredits']['datavalues'][] = [
'path' => __DIR__,
'name' => 'DataValues JavaScript',
Expand All @@ -34,54 +38,3 @@
include __DIR__ . '/lib/resources.php',
include __DIR__ . '/src/resources.php'
);

/**
* Register QUnit test base classes used by test modules in dependent components.
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
* @since 0.1
*
* @param array &$testModules
* @param \ResourceLoader &$resourceLoader
*
* @return boolean
*/
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] = function(
array &$testModules,
\ResourceLoader &$resourceLoader
) {
preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . '(?:vendor|extensions)'
. preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, $remoteExtPath );

$moduleTemplate = [
'localBasePath' => __DIR__ . '/tests',
'remoteExtPath' => '..' . $remoteExtPath[0] . DIRECTORY_SEPARATOR . 'tests',
];

$testModuleTemplates = [
'valueFormatters.tests' => $moduleTemplate + [
'scripts' => [
'src/valueFormatters/valueFormatters.tests.js',
],
'dependencies' => [
'dataValues.DataValue',
'util.inherit',
'valueFormatters',
],
],

'valueParsers.tests' => $moduleTemplate + [
'scripts' => [
'src/valueParsers/valueParsers.tests.js',
],
'dependencies' => [
'dataValues.DataValue',
'util.inherit',
'valueParsers',
],
],
];

$testModules['qunit'] = array_merge( $testModules['qunit'], $testModuleTemplates );

return true;
};
16 changes: 0 additions & 16 deletions build/travis/script.sh

This file was deleted.

230 changes: 0 additions & 230 deletions config.js

This file was deleted.

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

files: [
'node_modules/jquery/dist/jquery.js',
'lib/util/util.inherit.js',
'lib/globeCoordinate/globeCoordinate.js',
'lib/globeCoordinate/globeCoordinate.GlobeCoordinate.js',
'lib/globeCoordinate/globeCoordinate.Formatter.js',
'src/dataValues.js',
'src/DataValue.js',
'src/values/*.js',
'src/valueFormatters/valueFormatters.js',
'src/valueFormatters/formatters/ValueFormatter.js',
'src/valueFormatters/formatters/*.js',
'src/valueParsers/valueParsers.js',
'src/valueParsers/ValueParserStore.js',
'src/valueParsers/parsers/ValueParser.js',
'src/valueParsers/parsers/*.js',
'tests/lib/globeCoordinate/*.js',
'tests/src/dataValues.tests.js',
'tests/src/dataValues.DataValue.tests.js',
'tests/src/values/*.js',
'tests/src/valueFormatters/valueFormatters.tests.js',
'tests/src/valueFormatters/formatters/*.js',
'tests/src/valueParsers/valueParsers.tests.js',
'tests/src/valueParsers/ValueParserStore.tests.js',
'tests/src/valueParsers/parsers/*.js'
],

port: 9876,

logLevel: config.LOG_INFO,
browsers: [ 'PhantomJS' ]
} );
};
Loading