Use Angular CLI instead of ngm for building
Some commands: npm run build - to build the library. Output is in dist/ng2-file-upload/. npm run test - to run tests. Coverage report is in coverage/ as before. npm run demo.serve - to build demo application and serve it through browsersync npm run start - to run demo application using `ng serve`. Requires the library to be built and linked first.
This commit is contained in:
committed by
Evgeny Arshinov
parent
6cb3f87e57
commit
7a342268bb
72
test/karma.conf.js
Normal file
72
test/karma.conf.js
Normal file
@@ -0,0 +1,72 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||
|
||||
const customLaunchers = require('./sauce-browsers').customLaunchers;
|
||||
|
||||
module.exports = function (config) {
|
||||
const configuration = {
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../coverage'), reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: false
|
||||
},
|
||||
|
||||
reporters: ['dots', 'coverage-istanbul'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: true,
|
||||
customLaunchers: {
|
||||
Chrome_travis_ci: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
mime: { 'text/x-typescript': ['ts','tsx'] },
|
||||
client: { captureConsole: true }
|
||||
};
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
configuration.browsers = ['Chrome_travis_ci'];
|
||||
}
|
||||
|
||||
if (process.env.SAUCE) {
|
||||
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
|
||||
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
configuration.plugins.push(require('karma-sauce-launcher'));
|
||||
configuration.reporters.push('saucelabs');
|
||||
configuration.sauceLabs = {
|
||||
verbose: true,
|
||||
testName: 'ng2-bootstrap unit tests',
|
||||
recordScreenshots: false,
|
||||
username: process.env.SAUCE_USERNAME,
|
||||
accessKey: process.env.SAUCE_ACCESS_KEY,
|
||||
connectOptions: {
|
||||
port: 5757,
|
||||
logfile: 'sauce_connect.log'
|
||||
},
|
||||
public: 'public'
|
||||
};
|
||||
configuration.captureTimeout = 0;
|
||||
configuration.customLaunchers = customLaunchers();
|
||||
configuration.browsers = Object.keys(configuration.customLaunchers);
|
||||
configuration.concurrency = 3;
|
||||
configuration.browserDisconnectTolerance = 2;
|
||||
configuration.browserNoActivityTimeout = 20000;
|
||||
configuration.browserDisconnectTimeout = 5000;
|
||||
}
|
||||
|
||||
config.set(configuration);
|
||||
};
|
||||
Reference in New Issue
Block a user