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

Commit

Permalink
♻️ Deleted non used code and fix test language
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Feb 26, 2018
1 parent 285c7d1 commit c06eecb
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 52 deletions.
26 changes: 0 additions & 26 deletions test/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ process.env.LISKY_CONFIG_DIR =
process.env.LISKY_CONFIG_DIR || `${os.homedir()}/.lisky`;

/* eslint-disable no-underscore-dangle */
Assertion.addProperty('hexString', function handleAssert() {
const actual = this._obj;

new Assertion(actual).to.be.a('string');

const expected = Buffer.from(actual, 'hex').toString('hex');
this.assert(
expected === actual,
'expected #{this} to be a hex string',
'expected #{this} not to be a hex string',
);
});

Assertion.addProperty('integer', function handleAssert() {
const actual = this._obj;

new Assertion(actual).to.be.a('number');

const expected = parseInt(actual, 10);
this.assert(
actual === expected,
'expected #{this} to be an integer',
'expected #{this} not to be an integer',
);
});

Assertion.addMethod('matchAny', function handleAssert(matcher) {
const obj = this._obj;

Expand Down
2 changes: 1 addition & 1 deletion test/steps/api/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function itShouldBroadcastTheTransaction() {

export function itShouldResolveToTheAPIResponse() {
const { returnValue, apiResponse } = this.test.ctx;
return returnValue.should.be.eventually.eql(apiResponse);
return returnValue.should.eventually.eql(apiResponse);
}

export function theLiskAPIInstanceShouldBeALiskJSAPIInstance() {
Expand Down
2 changes: 1 addition & 1 deletion test/steps/config/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function itShouldUpdateTheConfigVariableToBoolean() {

export function itShouldResolveToTheConfig() {
const { returnValue, config } = this.test.ctx;
return returnValue.should.be.eventually.eql(config);
return returnValue.should.eventually.eql(config);
}

export function theDefaultConfigShouldBeExported() {
Expand Down
26 changes: 13 additions & 13 deletions test/steps/crypto/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export function itShouldSignTheMessageWithThePassphrase() {

export function itShouldResolveToTheResultOfSigningTheMessage() {
const { returnValue, cryptoResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(cryptoResult);
return returnValue.should.eventually.eql(cryptoResult);
}

export function itShouldResolveToTheResultOfDecryptingThePassphrase() {
const { returnValue, cryptoResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(cryptoResult);
return returnValue.should.eventually.eql(cryptoResult);
}

export function itShouldDecryptThePassphraseUsingTheIVAndThePassword() {
Expand All @@ -46,7 +46,7 @@ export function itShouldDecryptThePassphraseUsingTheIVAndThePassword() {

export function itShouldResolveToTheResultOfEncryptingThePassphraseCombinedWithThePublicKey() {
const { returnValue, cryptoResult, publicKey } = this.test.ctx;
return returnValue.should.be.eventually.eql(
return returnValue.should.eventually.eql(
Object.assign({}, cryptoResult, { publicKey }),
);
}
Expand All @@ -61,7 +61,7 @@ export function itShouldEncryptThePassphraseUsingThePassword() {

export function itShouldResolveToTheResultOfEncryptingThePassphrase() {
const { returnValue, cryptoResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(cryptoResult);
return returnValue.should.eventually.eql(cryptoResult);
}

export function itShouldDecryptTheMessageUsingTheNonceThePassphraseAndTheSenderPublicKey() {
Expand All @@ -76,7 +76,7 @@ export function itShouldDecryptTheMessageUsingTheNonceThePassphraseAndTheSenderP

export function itShouldResolveToTheResultOfDecryptingTheMessage() {
const { returnValue, cryptoResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(cryptoResult);
return returnValue.should.eventually.eql(cryptoResult);
}

export function itShouldEncryptTheMessageWithThePassphraseForTheRecipient() {
Expand All @@ -90,7 +90,7 @@ export function itShouldEncryptTheMessageWithThePassphraseForTheRecipient() {

export function itShouldResolveToTheResultOfEncryptingTheMessage() {
const { returnValue, cryptoResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(cryptoResult);
return returnValue.should.eventually.eql(cryptoResult);
}

export function itShouldResolveToAnObjectWithThePassphraseAndThePublicKeyAndTheAddress() {
Expand All @@ -105,7 +105,7 @@ export function itShouldResolveToAnObjectWithThePassphraseAndThePublicKeyAndTheA
publicKey,
address,
};
return returnValue.should.be.eventually.eql(expectedObject);
return returnValue.should.eventually.eql(expectedObject);
}

export function theSignatureShouldBeReturned() {
Expand Down Expand Up @@ -215,12 +215,12 @@ export function theDecryptedMessageShouldBeReturned() {

export function itShouldResolveToThePassphrase() {
const { returnValue, passphrase } = this.test.ctx;
return returnValue.should.be.eventually.eql(passphrase);
return returnValue.should.eventually.eql(passphrase);
}

export function itShouldReturnAnObjectWithThePassphrase() {
const { returnValue, passphrase } = this.test.ctx;
return returnValue.should.be.eventually.eql({
return returnValue.should.eventually.eql({
passphrase,
secondPassphrase: null,
password: null,
Expand All @@ -230,7 +230,7 @@ export function itShouldReturnAnObjectWithThePassphrase() {

export function itShouldReturnAnObjectWithTheSecondPassphrase() {
const { returnValue, secondPassphrase } = this.test.ctx;
return returnValue.should.be.eventually.eql({
return returnValue.should.eventually.eql({
passphrase: null,
secondPassphrase,
password: null,
Expand All @@ -240,7 +240,7 @@ export function itShouldReturnAnObjectWithTheSecondPassphrase() {

export function itShouldReturnAnObjectWithThePassword() {
const { returnValue, password } = this.test.ctx;
return returnValue.should.be.eventually.eql({
return returnValue.should.eventually.eql({
passphrase: null,
secondPassphrase: null,
password,
Expand All @@ -250,7 +250,7 @@ export function itShouldReturnAnObjectWithThePassword() {

export function itShouldReturnAnObjectWithTheData() {
const { returnValue, data } = this.test.ctx;
return returnValue.should.be.eventually.eql({
return returnValue.should.eventually.eql({
passphrase: null,
secondPassphrase: null,
password: null,
Expand All @@ -266,7 +266,7 @@ export function itShouldReturnAnObjectWithThePassphraseTheSecondPassphraseThePas
password,
data,
} = this.test.ctx;
return returnValue.should.be.eventually.eql({
return returnValue.should.eventually.eql({
passphrase,
secondPassphrase,
password,
Expand Down
2 changes: 1 addition & 1 deletion test/steps/files/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ export function theConfigFileShouldNotBeWritten() {

export function itShouldResolveToTheFirstLineOfTheFile() {
const { returnValue, passphrase } = this.test.ctx;
return returnValue.should.be.eventually.eql(passphrase);
return returnValue.should.eventually.eql(passphrase);
}
12 changes: 6 additions & 6 deletions test/steps/general/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function itShouldExitWithCode() {

export function itShouldResolveToTheErrorObject() {
const { returnValue, errorObject } = this.test.ctx;
return returnValue.should.be.eventually.eql(errorObject);
return returnValue.should.eventually.eql(errorObject);
}

export async function itShouldResolveToAnObjectWithMessage() {
Expand Down Expand Up @@ -112,7 +112,7 @@ export function itShouldRejectWithTheOriginalRejection() {

export function itShouldReturnAnEmptyObject() {
const { returnValue } = this.test.ctx;
return returnValue.should.be.eventually.eql({});
return returnValue.should.eventually.eql({});
}

export function itShouldReturnTrue() {
Expand All @@ -139,12 +139,12 @@ export function itShouldReturnString() {

export function itShouldResolveToTheOptions() {
const { options, returnValue } = this.test.ctx;
return returnValue.should.be.eventually.eql(options);
return returnValue.should.eventually.eql(options);
}

export function itShouldResolveToTheDataAsAString() {
const { returnValue, data } = this.test.ctx;
return returnValue.should.be.eventually.eql(data);
return returnValue.should.eventually.eql(data);
}

export function itShouldReturnAnObjectWithError() {
Expand All @@ -157,10 +157,10 @@ export function itShouldReturnAnObjectWithError() {

export function itShouldResolveToTheWarrantyInformation() {
const { returnValue, warranty } = this.test.ctx;
return returnValue.should.be.eventually.eql({ warranty });
return returnValue.should.eventually.eql({ warranty });
}

export function itShouldResolveToTheCopyrightInformation() {
const { returnValue, copyright } = this.test.ctx;
return returnValue.should.be.eventually.eql({ copyright });
return returnValue.should.eventually.eql({ copyright });
}
6 changes: 3 additions & 3 deletions test/steps/queries/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getFirstQuotedString } from '../utils';

export function itShouldResolveToTheResultOfSendingTheRequest() {
const { returnValue, sendRequestResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(sendRequestResult);
return returnValue.should.eventually.eql(sendRequestResult);
}

export function theQueryInstanceShouldHaveTheLiskAPIInstanceAsAClient() {
Expand All @@ -33,11 +33,11 @@ export function theQueryInstanceShouldHaveAHandlerFor() {

export function itShouldResolveToTheResultOfTheQuery() {
const { returnValue, queryResult } = this.test.ctx;
return returnValue.should.be.eventually.eql(queryResult);
return returnValue.should.eventually.eql(queryResult);
}

export function itShouldResolveToAnArrayOfQueryResults() {
const { returnValue, inputs, queryResult } = this.test.ctx;
const arrayOfQueryResults = inputs.map(() => queryResult);
return returnValue.should.be.eventually.eql(arrayOfQueryResults);
return returnValue.should.eventually.eql(arrayOfQueryResults);
}
2 changes: 1 addition & 1 deletion test/steps/transactions/3_then.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function itShouldCreateARegisterSecondPassphraseTransactionUsingThePassph

export function itShouldResolveToTheCreatedTransaction() {
const { returnValue, createdTransaction } = this.test.ctx;
return returnValue.should.be.eventually.eql(createdTransaction);
return returnValue.should.eventually.eql(createdTransaction);
}

export function itShouldCreateARegisterDelegateTransactionUsingThePassphraseAndTheDelegateUsername() {
Expand Down

0 comments on commit c06eecb

Please sign in to comment.