Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
cleanup (#19)
Browse files Browse the repository at this point in the history
* cleanup
 🐿2.5.10

* what's that procfile doing here
 🐿2.5.10

* remove old stuff
 🐿2.5.10
  • Loading branch information
lc512k authored Jul 12, 2017
1 parent 33b3037 commit 7b7bf94
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 199 deletions.
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

27 changes: 4 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
# TODO n.Makefile & nht
node_modules/@financial-times/n-gage/index.mk:
npm install --no-save --no-package-lock @financial-times/n-gage
touch $@

.PHONY: test

clean:
git clean -fxd

install:
@echo "Installing…"
@npm install

verify:
@echo "Verifying…"
@find ./src ./test -type f -exec lintspaces -e .editorconfig -i js-comments {} + &&\
eslint -c ./.eslintrc.js ./src ./test
-include node_modules/@financial-times/n-gage/index.mk

unit-test:
@echo "Unit Testing…"
@mocha --require test/setup --recursive --reporter spec test

test: verify unit-test

build: $(shell find src -type f)
@echo "Building…"
@rm -rf build
@babel -d build src

npm-publish:
npm-prepublish --verbose
npm publish --access public
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

134 changes: 0 additions & 134 deletions n.Makefile

This file was deleted.

5 changes: 0 additions & 5 deletions nodemon.json

This file was deleted.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"license": "MIT",
"devDependencies": {
"@financial-times/n-gage": "^1.8.21",
"babel-cli": "^6.5.1",
"babel-plugin-transform-object-assign": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
Expand All @@ -29,6 +30,9 @@
},
"version": "0.0.0",
"scripts": {
"prepublish": "make build"
"prepublish": "make build",
"precommit": "node_modules/.bin/secret-squirrel",
"commitmsg": "node_modules/.bin/secret-squirrel-commitmsg",
"prepush": "make verify -j3"
}
}
21 changes: 1 addition & 20 deletions src/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ module.exports = function sendSlackNotification ({
init,
error,
reports,
// packageJson,
verbose,
compact,
appName = 'Regression',
suite
// appLogo = 'https://next-geebee.ft.com/assets/brand-ft/icons/favicon-32x32.png'
}={}) {

// const appGithub = packageJson && packageJson.repository ? packageJson.repository.url : '';
// const appHerokuName = packageJson ? packageJson.name : '';

logger.info('compact? ', compact);

if (init && verbose) {
Expand Down Expand Up @@ -97,17 +92,8 @@ module.exports = function sendSlackNotification ({

const attachmentSuccess = {
'fallback': 'All tests passed',
// 'pretext': 'All regression tests passed!',
// 'author_name': 'Saucelabs Dashboard',
// 'author_link': 'https://saucelabs.com/beta/dashboard/tests',
// 'author_icon': 'https://marketplace-cdn.atlassian.com/files/images/2fdb6577-55eb-4d53-a5f5-87771ea85929.png',
// 'title': `${appHerokuName}`,
// 'title_link': appGithub,
'color': 'good',
'fields': successFields,
// 'footer': `${appName}`,
// 'footer_icon': appLogo,
// 'ts': Date.now() / 1000
'fields': successFields
}

const successBody = {
Expand All @@ -125,24 +111,19 @@ module.exports = function sendSlackNotification ({

if (failuresFound === 0) {
successBody.body = JSON.stringify(successBody.body);
// logger.info('sending success body')
logger.info(successBody)
fetch(SLACK_URL, successBody);
}
else {
const attachmentFailure = JSON.parse(JSON.stringify(attachmentSuccess));
attachmentFailure.color = '#f00';
attachmentFailure.fields = failedFields;
// attachmentFailure.pretext = `${failuresFound} tests failed:`;
// attachmentFailure.text = SLACK_MENTIONS;
// attachmentSuccess.pretext = 'These tests have passed:'

const failureBody = JSON.parse(JSON.stringify(successBody));
failureBody.body.attachments = [attachmentFailure, attachmentSuccess];
failureBody.body.text = `${failuresFound} test cases failed, ${SLACK_MENTIONS}`;

failureBody.body = JSON.stringify(failureBody.body);
// logger.info('sending failure body')
logger.info(failureBody)
fetch(SLACK_URL, failureBody);
}
Expand Down

0 comments on commit 7b7bf94

Please sign in to comment.