mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-22 05:05:48 +00:00
Shorten unit test names
This commit is contained in:
@@ -6,15 +6,19 @@ function json(object) {
|
|||||||
return JSON.stringify(object);
|
return JSON.stringify(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function truncateForDisplay(longStr) {
|
||||||
|
return longStr.slice(0, 10) + '...' + longStr.slice(-10);
|
||||||
|
}
|
||||||
|
|
||||||
describe('ripple-binary-codec', function() {
|
describe('ripple-binary-codec', function() {
|
||||||
function makeSuite(name, entries) {
|
function makeSuite(name, entries) {
|
||||||
describe(name, function() {
|
describe(name, function() {
|
||||||
entries.forEach((t, test_n) => {
|
entries.forEach((t, test_n) => {
|
||||||
it(`${name}[${test_n}] can encode ${json(t.json)} to ${t.binary}`,
|
it(`${name}[${test_n}] can encode ${truncateForDisplay(json(t.json))} to ${truncateForDisplay(t.binary)}`,
|
||||||
() => {
|
() => {
|
||||||
assert.equal(t.binary, encode(t.json));
|
assert.equal(t.binary, encode(t.json));
|
||||||
});
|
});
|
||||||
it(`${name}[${test_n}] can decode ${t.binary} to ${json(t.json)}`,
|
it(`${name}[${test_n}] can decode ${truncateForDisplay(t.binary)} to ${truncateForDisplay(json(t.json))}`,
|
||||||
() => {
|
() => {
|
||||||
const decoded = decode(t.binary);
|
const decoded = decode(t.binary);
|
||||||
assert.deepEqual(t.json, decoded);
|
assert.deepEqual(t.json, decoded);
|
||||||
|
|||||||
Reference in New Issue
Block a user