Skip to content

Commit

Permalink
Merge pull request #124 from wmde/cicici
Browse files Browse the repository at this point in the history
Update the CI build
  • Loading branch information
Ladsgroup committed Oct 3, 2017
2 parents b949525 + 07be405 commit 8f92bcd
Show file tree
Hide file tree
Showing 47 changed files with 152 additions and 16,627 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
@@ -1,6 +1,2 @@
lib/jquery/**
lib/qunit/**
lib/qunit.parameterize/**
lib/require/**
node_modules/**
vendor/**
10 changes: 5 additions & 5 deletions .travis.yml
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
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
@@ -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' ]
} );
};

0 comments on commit 8f92bcd

Please sign in to comment.