mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Merge pull request #525 from clark800/test-compiled
Fix testing of compiled library
This commit is contained in:
10
bin/ci.sh
10
bin/ci.sh
@@ -24,9 +24,13 @@ unittest() {
|
||||
npm run coveralls
|
||||
|
||||
# test compiled version in "dist/npm"
|
||||
ln -nfs ../../dist/npm/core test/node_modules/ripple-lib
|
||||
ln -nfs ../../dist/npm test/node_modules/ripple-api
|
||||
npm test
|
||||
babel -D --optional runtime --ignore "**/node_modules/**" -d test-compiled/ test/
|
||||
echo "--reporter spec --timeout 5000 --slow 500" > test-compiled/mocha.opts
|
||||
mkdir -p test-compiled/node_modules
|
||||
ln -nfs ../../dist/npm/core test-compiled/node_modules/ripple-lib
|
||||
ln -nfs ../../dist/npm test-compiled/node_modules/ripple-api
|
||||
mocha --opts test-compiled/mocha.opts test-compiled
|
||||
rm -rf test-compiled
|
||||
}
|
||||
|
||||
oneNode() {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* SerializedObject.parse() or SerializedObject.serialize().
|
||||
*/
|
||||
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert');
|
||||
const extend = require('extend');
|
||||
const BN = require('bn.js');
|
||||
@@ -404,7 +405,7 @@ exports.Quality = new SerializedType({
|
||||
serialize: function(so, val) {
|
||||
let value;
|
||||
// if in format: amount/currency/issuer
|
||||
if (val.includes('/')) {
|
||||
if (_.includes(val, '/')) {
|
||||
const amount = Amount.from_json(val);
|
||||
|
||||
if (!amount.is_valid()) {
|
||||
|
||||
4
test/fixtures/api/rippled/account-tx.js
vendored
4
test/fixtures/api/rippled/account-tx.js
vendored
@@ -3,11 +3,11 @@
|
||||
const _ = require('lodash');
|
||||
const hashes = require('../../hashes');
|
||||
const addresses = require('../../addresses');
|
||||
const SerializedObject = require('../../../../src/core').SerializedObject;
|
||||
const SerializedObject = require('ripple-lib').SerializedObject;
|
||||
const AccountSet = require('./tx/account-set.json');
|
||||
const NotFound = require('./tx/not-found.json');
|
||||
|
||||
module.exports = function(request, options={}) {
|
||||
module.exports = function(request, options = {}) {
|
||||
_.defaults(options, {
|
||||
memos: [{
|
||||
Memo: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable max-len */
|
||||
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert-diff');
|
||||
const lodash = require('lodash');
|
||||
const ripple = require('ripple-lib');
|
||||
@@ -75,11 +75,11 @@ function makeTests(uIntType) {
|
||||
case undefined:
|
||||
switch (test.outputMethod) {
|
||||
case 'to_bytes':
|
||||
test.expected = Array(rippleType.width).fill(0);
|
||||
test.expected = _.fill(Array(rippleType.width), 0);
|
||||
break;
|
||||
case 'to_json':
|
||||
case 'to_hex':
|
||||
test.expected = Array(rippleType.width * 2).fill(0).join('');
|
||||
test.expected = _.fill(Array(rippleType.width * 2), 0).join('');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user