diff --git a/test/setup.js b/test/setup.js index ca471ad9..cb296c5e 100644 --- a/test/setup.js +++ b/test/setup.js @@ -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; diff --git a/test/steps/api/3_then.js b/test/steps/api/3_then.js index dc604d54..5d24cdb8 100644 --- a/test/steps/api/3_then.js +++ b/test/steps/api/3_then.js @@ -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() { diff --git a/test/steps/config/3_then.js b/test/steps/config/3_then.js index ce46a5b7..5fdf86e8 100644 --- a/test/steps/config/3_then.js +++ b/test/steps/config/3_then.js @@ -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() { diff --git a/test/steps/crypto/3_then.js b/test/steps/crypto/3_then.js index 8d3bf2d8..dc53f6af 100644 --- a/test/steps/crypto/3_then.js +++ b/test/steps/crypto/3_then.js @@ -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() { @@ -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 }), ); } @@ -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() { @@ -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() { @@ -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() { @@ -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() { @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/test/steps/files/3_then.js b/test/steps/files/3_then.js index 6fea5b94..02fd3fa3 100644 --- a/test/steps/files/3_then.js +++ b/test/steps/files/3_then.js @@ -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); } diff --git a/test/steps/general/3_then.js b/test/steps/general/3_then.js index cb69d442..43facf76 100644 --- a/test/steps/general/3_then.js +++ b/test/steps/general/3_then.js @@ -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() { @@ -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() { @@ -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() { @@ -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 }); } diff --git a/test/steps/queries/3_then.js b/test/steps/queries/3_then.js index 88c436e2..f857c090 100644 --- a/test/steps/queries/3_then.js +++ b/test/steps/queries/3_then.js @@ -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() { @@ -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); } diff --git a/test/steps/transactions/3_then.js b/test/steps/transactions/3_then.js index b309ee87..0caeb766 100644 --- a/test/steps/transactions/3_then.js +++ b/test/steps/transactions/3_then.js @@ -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() {