2020-10-24 06:36:36 +00:00
|
|
|
const commonjs = require("@rollup/plugin-commonjs");
|
|
|
|
const resolve = require("@rollup/plugin-node-resolve").default;
|
|
|
|
const rollupReplace = require("@rollup/plugin-replace");
|
|
|
|
|
|
|
|
const NODE_ENV = process.env.NODE_ENV || 'test';
|
|
|
|
|
2018-05-29 21:53:35 +00:00
|
|
|
module.exports = function(config) {
|
|
|
|
config.set({
|
2020-10-16 12:31:45 +00:00
|
|
|
reporters: ['tfs', 'spec'],
|
2018-06-01 16:46:10 +00:00
|
|
|
basePath: '../',
|
2018-05-29 21:53:35 +00:00
|
|
|
frameworks: ['mocha', 'chai', 'sinon-chai'],
|
|
|
|
files: [
|
2019-07-04 23:17:54 +00:00
|
|
|
'./node_modules/jquery/dist/jquery.min.js',
|
2019-11-07 18:12:37 +00:00
|
|
|
'./node_modules/jquery-textcomplete/dist/jquery.textcomplete.min.js',
|
2019-07-04 23:17:54 +00:00
|
|
|
'./node_modules/bluebird/js/browser/bluebird.min.js',
|
2019-11-07 18:12:37 +00:00
|
|
|
'./node_modules/jbox/dist/jBox.min.js',
|
2018-05-29 21:53:35 +00:00
|
|
|
'./src/js/serial.js',
|
|
|
|
'./src/js/data_storage.js',
|
2020-10-24 06:36:36 +00:00
|
|
|
{ pattern: './src/js/localization.js', type: 'module', watched: false },
|
2018-05-29 21:53:35 +00:00
|
|
|
'./src/js/gui.js',
|
2019-03-23 23:21:52 +00:00
|
|
|
'./src/js/CliAutoComplete.js',
|
2018-05-29 21:53:35 +00:00
|
|
|
'./src/js/tabs/cli.js',
|
2020-07-03 14:18:55 +00:00
|
|
|
'./src/js/phones_ui.js',
|
2020-10-16 12:31:45 +00:00
|
|
|
'./test/**/*.js',
|
2018-05-29 21:53:35 +00:00
|
|
|
],
|
2018-06-01 16:46:10 +00:00
|
|
|
browsers: ['ChromeHeadlessNoSandbox'],
|
|
|
|
customLaunchers: {
|
|
|
|
ChromeHeadlessNoSandbox: {
|
|
|
|
base: 'ChromeHeadless',
|
2020-10-16 12:31:45 +00:00
|
|
|
flags: ['--no-sandbox'],
|
|
|
|
},
|
2018-06-01 16:46:10 +00:00
|
|
|
},
|
2019-11-06 14:58:27 +00:00
|
|
|
tfsReporter: {
|
|
|
|
outputDir: 'testresults',
|
2019-11-06 18:28:33 +00:00
|
|
|
outputFile: 'test_results.xml',
|
2019-11-06 14:58:27 +00:00
|
|
|
},
|
|
|
|
singleRun: true,
|
2020-10-24 06:36:36 +00:00
|
|
|
preprocessors: {
|
|
|
|
'./src/js/localization.js': ['rollup'],
|
|
|
|
},
|
|
|
|
rollupPreprocessor: {
|
|
|
|
plugins: [
|
|
|
|
rollupReplace({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
|
|
|
}),
|
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
],
|
|
|
|
output: {
|
|
|
|
format: 'esm',
|
|
|
|
},
|
|
|
|
},
|
2018-05-29 21:53:35 +00:00
|
|
|
});
|
|
|
|
};
|