Move the karma config and node_modules into the web directory.

This commit is contained in:
Atira Odhner 2017-03-15 17:13:55 +00:00 committed by Dave Page
parent ae0d8e89eb
commit 5593faf2a4
5 changed files with 16 additions and 15 deletions

View File

@ -15,18 +15,18 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
{pattern: 'test/javascript/**/*.js', included: false},
{pattern: 'web/pgadmin/static/vendor/**/*.js', included: false},
{pattern: 'web/pgadmin/static/js/**/*.js', included: false},
'test/javascript/test-main.js'
{pattern: 'regression/javascript/**/*.js', included: false},
{pattern: 'pgadmin/static/vendor/**/*.js', included: false},
{pattern: 'pgadmin/static/js/**/*.js', included: false},
'regression/javascript/test-main.js'
],
// list of files to exclude
exclude: [
'web/pgadmin/static/js/pgadmin.js',
'web/pgadmin/static/vendor/**/*[Tt]est.js',
'web/pgadmin/static/vendor/**/*[Ss]pec.js'
'pgadmin/static/js/pgadmin.js',
'pgadmin/static/vendor/**/*[Tt]est.js',
'pgadmin/static/vendor/**/*[Ss]pec.js'
],
@ -66,7 +66,7 @@ module.exports = function(config) {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous

View File

@ -157,15 +157,16 @@ Python Tests
run 'python runtests.py --exclude browser.server_groups.servers.databases,browser.server_groups.servers.tablespaces'
Javascript Tests
javascript tests must be run from the web directory (since that is where node_modules and karma.conf reside)
cd web/
brew install nodejs
npm install
brew install yarn
yarn
you may wish to install the karma cli, so it is accessible globally:
install the karma cli, so it is accessible globally:
npm install -g karma-cli
Otherwise you can use:
./node_modules/karma/bin/karma
to run tests:
karma start --single-run

View File

@ -12,7 +12,7 @@ Object.keys(window.__karma__.files).forEach(function (file) {
}
});
var sourcesDir = '/base/web/pgadmin/static/';
var sourcesDir = '/base/pgadmin/static/';
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: '/base',
@ -26,7 +26,7 @@ require.config({
'slickgrid': sourcesDir + 'vendor/slickgrid/slick.core',
'slickgrid/slick.grid': sourcesDir + 'vendor/slickgrid/slick.grid',
'slickgrid/slick.rowselectionmodel': sourcesDir + 'vendor/slickgrid/plugins/slick.rowselectionmodel',
'translations': '/base/test/javascript/fake_translations',
'translations': '/base/regression/javascript/fake_translations',
'sources': sourcesDir + 'js'
},