gooderp18绿色标准版
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

97 lines
2.9KB

  1. /////////////////////////////////////////////////////////////
  2. //
  3. // pgAdmin 4 - PostgreSQL Tools
  4. //
  5. // Copyright (C) 2013 - 2020, The pgAdmin Development Team
  6. // This software is released under the PostgreSQL Licence
  7. //
  8. //////////////////////////////////////////////////////////////
  9. // Karma configuration
  10. const webpackConfig = require('./webpack.test.config.js');
  11. const isDocker = require('is-docker')();
  12. const webpack = require('webpack');
  13. module.exports = function (config) {
  14. config.set({
  15. frameworks: ['jasmine', 'source-map-support'],
  16. reporters: ['progress', 'kjhtml'],
  17. plugins: [
  18. 'karma-webpack',
  19. 'karma-chrome-launcher',
  20. 'karma-jasmine',
  21. 'karma-jasmine-html-reporter',
  22. 'karma-source-map-support',
  23. 'karma-sourcemap-loader',
  24. new webpack.SourceMapDevToolPlugin({
  25. /*
  26. * filename: null, // if no value is provided the sourcemap is inlined
  27. */
  28. filename: '[name].js.map',
  29. test: /\.js$/i, // process .js files only
  30. }),
  31. ],
  32. files: [
  33. 'pgadmin/static/bundle/slickgrid.js',
  34. {pattern: 'pgadmin/static/**/*.js', included: false, watched: true},
  35. {pattern: 'pgadmin/browser/static/js/**/*.js', included: false, watched: true},
  36. {pattern: 'regression/javascript/**/*.js', watched: true},
  37. ],
  38. // list of files to exclude
  39. exclude: [
  40. 'pgadmin/static/vendor/**/*[Tt]est.js',
  41. 'pgadmin/static/vendor/**/*[Ss]pec.js',
  42. ],
  43. // preprocess matching files before serving them to the browser
  44. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  45. preprocessors: {
  46. 'pgadmin/**/js/**/*.js?': ['sourcemap'],
  47. 'regression/javascript/**/*.js': ['webpack', 'sourcemap'],
  48. 'pgadmin/static/bundle/slickgrid.js': ['webpack', 'sourcemap'],
  49. },
  50. webpack: webpackConfig,
  51. webpackMiddleware: {
  52. stats: 'errors-only',
  53. },
  54. port: 9876,
  55. // enable / disable colors in the output (reporters and logs)
  56. colors: true,
  57. // level of logging
  58. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  59. logLevel: config.LOG_WARN,
  60. // enable / disable watching file and executing tests whenever any file changes
  61. autoWatch: true,
  62. usePolling: true,
  63. // start these browsers
  64. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  65. customLaunchers: {
  66. ChromeCustom: {
  67. base: 'ChromeHeadless',
  68. // We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
  69. // more permissions than Docker allows by default)
  70. flags: isDocker ? ['--no-sandbox'] : [],
  71. },
  72. },
  73. browsers: ['ChromeCustom'],
  74. // Continuous Integration mode
  75. // if true, Karma captures browsers, runs the tests and exits
  76. singleRun: false,
  77. // Concurrency level
  78. // how many browser should be started simultaneous
  79. concurrency: Infinity,
  80. });
  81. };
上海开阖软件有限公司 沪ICP备12045867号-1