diff --git a/karma.conf.js b/karma.conf.js index 0bbb322..e115316 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -29,7 +29,11 @@ module.exports = function (config) { "directory": "coverage", "subdirectory": "report" }, - "text-summary": "" + "text-summary": "", + "json-summary": { + "directory": "coverage", + "subdirectory": "summary" + } }, compilerOptions: { lib: [ diff --git a/ps_spec.yml b/ps_spec.yml index 6524612..cc3d979 100644 --- a/ps_spec.yml +++ b/ps_spec.yml @@ -21,6 +21,18 @@ stages: - npm run build - npx madge --circular --extensions ts --ts-config tsconfig.json src - | + + echo "start" + + ls + + if [ -f coverage/summary/json-summary.json ]; then + cat coverage/summary/json-summary.json + echo "coverage json data found " > comments.txt + else + echo "coverage json data not found. Add `json-summary` to .karmaTypescriptConfig.reports in `karma.conf.js` " > comments.txt + + CODEBUILD_SOURCE_VERSION_WARNING="master" if [ "$CODEBUILD_SOURCE_VERSION" = "$CODEBUILD_SOURCE_VERSION_WARNING" ]; then curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2 @@ -28,9 +40,11 @@ stages: PKGNAME=$(node -e 'console.log(require("./package.json").name)') PKGVERSION=$(node -e 'console.log(require("./package.json").version)') LATEST_VERSION=$(npm show $PKGNAME version) - echo "⚠️ **WARNING** - Merging this pull request will result in a publish of **$PKGNAME** to npm from version **$LATEST_VERSION** to **$PKGVERSION**" > comments.txt - bin/hub api repos/alertlogic/$ALPS_REPO_NAME/issues/$ALPS_PR_NUMBER/comments --field body=@comments.txt + echo "⚠️ **WARNING** - Merging this pull request will result in a publish of **$PKGNAME** to npm from version **$LATEST_VERSION** to **$PKGVERSION**" >> comments.txt + fi + + bin/hub api repos/alertlogic/$ALPS_REPO_NAME/issues/$ALPS_PR_NUMBER/comments --field body=@comments.txt - echo done