push
github
5 of 5 branches covered (100.0%)
Branch coverage included in aggregate %.
112 of 183 new or added lines in 4 files covered. (61.2%)
112 of 183 relevant lines covered (61.2%)
1.84 hits per line
|
"use strict";
|
|
|
import bag from 'bagofcli'; |
3✔ |
|
import fs from 'fs'; |
3✔ |
|
import McpJenkins from './mcpJenkins.js'; |
3✔ |
|
import p from 'path'; |
3✔ |
|
|
3✔ |
|
const APP_DIR = process.cwd(), |
3✔ |
|
DIRNAME = p.dirname(import.meta.url).replace('file://', ''); |
3✔ |
|
|
3✔ |
NEW
|
function _run(args) { |
× |
NEW
|
|
× |
NEW
|
const pkgFile = p.join(DIRNAME, '..', 'package.json'); |
× |
NEW
|
const pkg = JSON.parse(fs.readFileSync(pkgFile)); |
× |
NEW
|
|
× |
NEW
|
const opts = { |
× |
NEW
|
url: process.env.JENKINS_URL || 'http://localhost:8080' |
× |
NEW
|
}; |
× |
NEW
|
|
× |
NEW
|
const mcpJenkins = new McpJenkins(pkg.name, pkg.version, opts);
|
× |
NEW
|
mcpJenkins.run(); |
× |
NEW
|
|
× |
NEW
|
} |
× |
|
|
3✔ |
|
/**
|
3✔ |
|
* Execute MCP Jenkins. |
3✔ |
|
*/ |
3✔ |
|
function exec() { |
|
|
|
3✔ |
|
const actions = { |
3✔ |
|
commands: {
|
3✔ |
|
run : { action: _run } |
3✔ |
|
} |
3✔ |
|
}; |
3✔ |
|
|
3✔ |
|
bag.command(DIRNAME, actions); |
3✔ |
|
} |
3✔ |
|
|
3✔ |
|
const exports = { |
3✔ |
|
exec: exec
|
3✔ |
|
}; |
3✔ |
|
|
3✔ |
|
export {
|
3✔ |
|
exports as default
|
3✔ |
|
}; |
3✔ |