Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #50 from LiskHQ/46_review-tests-in-travis
Browse files Browse the repository at this point in the history
Review tests in travis - Closes #46
  • Loading branch information
karmacoma authored Mar 7, 2017
2 parents b0081e1 + 0c8c515 commit 92c042b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
15 changes: 15 additions & 0 deletions .githooks/post-merge/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com

# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.

changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}

# Example usage
# In this example it's used to run `npm install` if package.json changed
check_run src/package.json "cd src && npm install"
5 changes: 5 additions & 0 deletions .githooks/pre-commit/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
cd src
npm run test

exit $?
10 changes: 5 additions & 5 deletions src/app/components/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.component('login', {
reset() {
this.input_passphrase = '';
this.progress = 0;
this.seed = this.emptyBytes().map(() => '00');
this.seed = login.emptyBytes().map(() => '00');
}

stop() {
Expand All @@ -41,14 +41,14 @@ app.component('login', {
}

go() {
this.passphrase = this.fix(this.input_passphrase);
this.passphrase = login.fix(this.input_passphrase);

this.reset();
this.$timeout(this.onLogin);
}

isValid(value) {
const fixedValue = this.fix(value);
const fixedValue = login.fix(value);

if (fixedValue === '') {
this.valid = 2;
Expand All @@ -65,7 +65,7 @@ app.component('login', {
this.random = true;

let last = [0, 0];
let used = this.emptyBytes();
let used = login.emptyBytes();

const turns = 10 + parseInt(Math.random() * 10, 10);
const steps = 2;
Expand Down Expand Up @@ -97,7 +97,7 @@ app.component('login', {
used[pos] = 1;

const update = () => {
this.seed[pos] = this.lpad(crypto.randomBytes(1)[0].toString(16), '0', 2);
this.seed[pos] = login.lpad(crypto.randomBytes(1)[0].toString(16), '0', 2);
this.progress = parseInt((count / total) * 100, 10);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/timestamp/timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.component('timestamp', {
update() {
this.$timeout.cancel(this.timeout);

const obj = moment(this.fix(this.data));
const obj = moment(timestamp.fix(this.data));
this.full = obj.format('LL LTS');
this.time_ago = obj.fromNow(true);

Expand Down
3 changes: 2 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "webpack --profile --progress --display-modules --display-exclude --display-chunks --display-cached --display-cached-assets",
"dev": "webpack-dev-server --host 0.0.0.0 --profile --progress",
"test": "nyc mocha"
"test": "grunt test && nyc mocha"
},
"dependencies": {
"angular": "=1.5.8",
Expand Down Expand Up @@ -35,6 +35,7 @@
"exports-loader": "=0.6.3",
"extract-text-webpack-plugin": "=1.0.1",
"file-loader": "=0.9.0",
"git-hooks": "^1.1.8",
"grunt": "=1.0.1",
"grunt-eslint": "=19.0.0",
"html-webpack-plugin": "=2.19.0",
Expand Down

0 comments on commit 92c042b

Please sign in to comment.