Karma framework for running an extendable express application.
npm install karma-express-serverRuns a customizable expressjs application for karma tests.
``bash`
npm install --save-dev karma-express-server
Add framework and expressServer configuration to karma config:
`javascript
module.exports = function(config) {
config.set({
// ...
frameworks: [
// ...
'expressServer'
],
// ...
expressServer: {
port: 9877, // different than karma's port
// custom extensions go here
extensions: [
// for example:
function(
app, // express app
logger // karma logger
) {
app.get('/heartbeat', (req, res) => {
res.sendStatus(200);
});
}
]
}
});
};
`
Self-signed certificates can be generated with nodejs-self-signed-certificate-example.
`javascript
// ...
expressServer: {
// ...
protocol: 'https',
httpsServerOptions: {
key: fs.readFileSync('path/to/my-server.key.pem'),
cert: fs.readFileSync('path/to/my-server.crt.pem')
}
}
// ...
``
All Config properties are documented in the API Documentation.
See Contribution documentation for build, test and publish details.