Felipe Reis 78f87104d6 BAEL-137 Intro do JHipster (#1427)
* refactor: Reorder tests without lambda

Moves inner implementations of Answer and ArgumentMatcher to the top of
the test classes.
Also changes the lambda expression to a regular "pre java 8" expression
in one of the tests.

Resolves: BAEL-632

* feat: Create basic Monolithic JHipster project

Commit just after creating a JHipster project, before making any modifications.

Resolves: BAEL-137

* chore: Change the artifactId and name of the project

From baeldung to jhipster-monolithic and JHipster Monolithic Application

Relates to: BAEL-137

* feat: Create entities Post and Comment

Relates to: BAEL-137

* feat: Fix Gatling configuration in pom.xml

Relates to: BAEL-137

* feat: Add files for Continuous Integration

Relates to: BAEL-137

* feat: Change pom.xml to conform to Baeldung standards

- moved the <properties> element to the bottom of the file
- excluded integration tests in the default surefire configuration
- added a new profile, called integration, and added the integration tests there
- added Java 8 in the <source> and <target> tags, under maven-compiler

solves: BAEL-137

* chore: Add jhipster module to parent pom
2017-03-21 12:23:41 +01:00

127 lines
4.3 KiB
JavaScript

'use strict';
const path = require('path');
const webpack = require('webpack');
const WATCH = process.argv.indexOf('--watch') > -1;
const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin");
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'intl-shim'],
// list of files / patterns to load in the browser
files: [
'spec/entry.ts'
],
// list of files to exclude
exclude: ['e2e/**'],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'spec/entry.ts': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/, enforce: 'pre', loader: 'tslint-loader', exclude: /(test|node_modules)/
},
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader?keepUrl=true'],
exclude: /node_modules/
},
{
test: /\.(html|css)$/,
loader: 'raw-loader',
exclude: /\.async\.(html|css)$/
},
{
test: /\.async\.(html|css)$/,
loaders: ['file?name=[name].[hash].[ext]', 'extract']
},
{
test: /\.scss$/,
loaders: ['to-string-loader', 'css-loader', 'sass-loader']
},
{
test: /src\/main\/webapp\/.+\.ts$/,
enforce: 'post',
exclude: /(test|node_modules)/,
loader: 'sourcemap-istanbul-instrumenter-loader?force-sourcemap=true'
}]
},
devtool: 'inline-source-map',
plugins: [
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
root('./src') // location of your src
),
new LoaderOptionsPlugin({
options: {
tslint: {
emitErrors: !WATCH,
failOnHint: false
}
}
})
]
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['dots', 'junit', 'progress', 'karma-remap-istanbul'],
junitReporter: {
outputFile: '../../../../target/test-results/karma/TESTS-results.xml'
},
remapIstanbulReporter: {
reports: { // eslint-disable-line
'html': 'target/test-results/coverage',
'text-summary': null
}
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: WATCH,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: !WATCH
});
};
function root(__path) {
return path.join(__dirname, __path);
}