Browse Source

Cleanup.

pull/342/head
Sebastian 7 years ago
parent
commit
06f7c69168
  1. 10
      src/Squidex/app-config/karma-test-shim.js
  2. 12
      src/Squidex/app-config/karma.conf.js
  3. 23
      src/Squidex/app-config/karma.coverage.conf.js
  4. 6
      src/Squidex/app-config/webpack.config.js
  5. 3
      src/Squidex/app-config/webpack.run.base.js
  6. 4
      src/Squidex/app-config/webpack.run.dev.js
  7. 8
      src/Squidex/app-config/webpack.run.prod.js
  8. 5
      src/Squidex/app-config/webpack.test.js
  9. 10
      src/Squidex/wwwroot/scripts/editor-sdk.js

10
src/Squidex/app-config/karma-test-shim.js

@ -21,14 +21,16 @@ testing.TestBed.initTestEnvironment(
var testContext = require.context('../app', true, /\.spec\.ts/);
/*
* get all the files, for each file, call the context function
/**
* Get all the files, for each file, call the context function
* that will require the file and load it up here. Context will
* loop and require those spec files here
* loop and require those spec files here.
*/
function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
}
// requires and returns all modules that match
/**
* Requires and returns all modules that match.
*/
var modules = requireAll(testContext);

12
src/Squidex/app-config/karma.conf.js

@ -3,14 +3,14 @@
module.exports = function (config) {
var _config = {
/**
* Base path that will be used to resolve all patterns (e.g. files, exclude)
* Base path that will be used to resolve all patterns (e.g. files, exclude).
*/
basePath: '',
frameworks: ['jasmine'],
/**
* Load additional test shim to setup angular2 for testing
* Load additional test shim to setup angular2 for testing.
*/
files: [
{ pattern: './app-config/karma-test-shim.js', watched: false }
@ -33,21 +33,21 @@ module.exports = function (config) {
noInfo: true
},
/*
* Leave Jasmine Spec Runner output visible in browser
/**
* Leave Jasmine Spec Runner output visible in browser.
*/
client: {
clearContext: false
},
/*
/**
* Use a mocha style console reporter and html reporter.
*/
reporters: ['kjhtml', 'mocha'],
/**
* Run with chrome to enable debugging
* Run with chrome to enable debugging.
*
* available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
*/

23
src/Squidex/app-config/karma.coverage.conf.js

@ -3,14 +3,14 @@
module.exports = function (config) {
var _config = {
/**
* Base path that will be used to resolve all patterns (e.g. files, exclude)
* Base path that will be used to resolve all patterns (e.g. files, exclude).
*/
basePath: '',
frameworks: ['jasmine'],
/**
* Load additional test shim to setup angular2 for testing
* Load additional test shim to setup angular2 for testing.
*/
files: [
{ pattern: './app-config/karma-test-shim.js', watched: false }
@ -33,21 +33,20 @@ module.exports = function (config) {
noInfo: true
},
/*
* Use a mocha style console reporter, html reporter and the code coverage reporter
/**
* Use a mocha style console reporter, html reporter and the code coverage reporter.
*/
reporters: ['mocha', 'html', 'coverage-istanbul'],
// HtmlReporter configuration
htmlReporter: {
useCompactStyle: true,
/**
* Use the same folder like the html report for coverage reports
* Use the same folder like the html report for coverage reports.
*/
outputFile: '_test-output/tests.html',
/**
* Group the output by test suite (describe), equivalent to mocha reporter
* Group the output by test suite (describe), equivalent to mocha reporter.
*/
groupSuites: true
},
@ -64,22 +63,24 @@ module.exports = function (config) {
},
/**
* Disable continuous Integration mode, run only one time
* Disable continuous Integration mode, run only one time.
*/
singleRun: true,
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
// We must disable the Chrome sandbox (Chrome's sandbox needs more permissions than Docker allows by default)
/**
* We must disable the Chrome sandbox (Chrome's sandbox needs more permissions than Docker allows by default).
*/
flags: ['--no-sandbox']
}
},
/**
* Run with chrome because phantom js does not provide all types, e.g. DragEvent
* Run with chrome because phantom js does not provide all types.
*
* available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
* Available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
*/
browsers: ['ChromeCustom']
};

6
src/Squidex/app-config/webpack.config.js

@ -33,7 +33,7 @@ module.exports = {
]
},
/*
/**
* Options affecting the normal modules.
*
* See: https://webpack.js.org/configuration/module/
@ -109,7 +109,7 @@ module.exports = {
},
plugins: [
/*
/**
* Puts each bundle into a file and appends the hash of the file to the path.
*
* See: https://github.com/webpack-contrib/mini-css-extract-plugin
@ -120,7 +120,7 @@ module.exports = {
options: {
htmlLoader: {
/**
* Define the root for images, so that we can use absolute url's
* Define the root for images, so that we can use absolute urls.
*
* See: https://github.com/webpack/html-loader#Advanced_Options
*/

3
src/Squidex/app-config/webpack.run.base.js

@ -10,8 +10,7 @@ const plugins = {
module.exports = webpackMerge(commonConfig, {
/**
* The entry point for the bundle
* Our Angular.js app
* The entry point for the bundle. Our Angular app.
*
* See: https://webpack.js.org/configuration/entry-context/
*/

4
src/Squidex/app-config/webpack.run.dev.js

@ -17,7 +17,9 @@ module.exports = webpackMerge(runConfig, {
output: {
filename: '[name].js',
// Set the public path, because we are running the website from another port (5000)
/**
* Set the public path, because we are running the website from another port (5000).
*/
publicPath: 'http://localhost:3000/'
},

8
src/Squidex/app-config/webpack.run.prod.js

@ -34,15 +34,13 @@ module.exports = webpackMerge(runConfig, {
/**
* Specifies the name of each output file on disk.
* IMPORTANT: You must not specify an absolute path here!
*
* See: https://webpack.js.org/configuration/output/#output-filename
*/
filename: '[name].js',
/**
* The filename of non-entry chunks as relative path
* inside the output.path directory.
* The filename of non-entry chunks as relative path inside the output.path directory.
*
* See: https://webpack.js.org/configuration/output/#output-chunkfilename
*/
@ -63,7 +61,7 @@ module.exports = webpackMerge(runConfig, {
rules: [{
test: /\.scss$/,
/*
* Extract the content from a bundle to a file
* Extract the content from a bundle to a file.
*
* See: https://github.com/webpack-contrib/extract-text-webpack-plugin
*/
@ -75,7 +73,7 @@ module.exports = webpackMerge(runConfig, {
loader: 'sass-loader'
}],
/*
* Do not include component styles
* Do not include component styles.
*/
include: helpers.root('app', 'theme'),
}, {

5
src/Squidex/app-config/webpack.test.js

@ -1,4 +1,4 @@
 const webpack = require('webpack'),
const webpack = require('webpack'),
webpackMerge = require('webpack-merge'),
path = require('path'),
helpers = require('./helpers'),
@ -8,9 +8,8 @@ module.exports = webpackMerge(commonConfig, {
mode: 'development',
/**
* Source map for Karma from the help of karma-sourcemap-loader & karma-webpack
* Source map for Karma from the help of karma-sourcemap-loader & karma-webpack.
*
* Do not change, leave as is or it wont work.
* See: https://webpack.js.org/configuration/devtool/
*/
devtool: 'inline-source-map'

10
src/Squidex/wwwroot/scripts/editor-sdk.js

@ -44,7 +44,7 @@ function SquidexFormField() {
}, 500);
var editor = {
/*
/**
* Notifies the control container that the editor has been touched.
*/
touched: function () {
@ -53,7 +53,7 @@ function SquidexFormField() {
}
},
/*
/**
* Notifies the control container that the value has been changed.
*/
valueChanged: function (value) {
@ -62,7 +62,7 @@ function SquidexFormField() {
}
},
/*
/**
* Register the disabled handler.
*/
onDisabled: function (callback) {
@ -73,7 +73,7 @@ function SquidexFormField() {
}
},
/*
/**
* Register the disabled handler.
*/
onValueChanged: function (callback) {
@ -84,7 +84,7 @@ function SquidexFormField() {
}
},
/*
/**
* Clean the editor SDK.
*/
clean: function () {

Loading…
Cancel
Save