Simon Priet e69a613a37 feat: Created a mini nodeJS server with NewMan for testing without PostMan GUI.
This will mimic a run in a CD/CI environment or docker container.
2021-09-08 14:01:19 +02:00

26 lines
933 B
JavaScript

#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to execute all unit tests in the Chrome Browser.
// ---------------------------------------------------------------------------------------------------------------------
/* eslint-env node, es6 */
require('shelljs/global');
var chalk = require('chalk'),
path = require('path'),
KARMA_CONFIG_PATH = path.join(__dirname, '..', 'test', 'karma.conf');
module.exports = function (exit) {
console.log(chalk.yellow.bold('Running unit tests within browser...'));
var KarmaServer = require('karma').Server;
(new KarmaServer({ // eslint-disable no-new
cmd: 'start',
configFile: KARMA_CONFIG_PATH
}, exit)).start();
};
// ensure we run this script exports if this is a direct stdin.tty run
!module.parent && module.exports(exit);