mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 19:48:13 +00:00
* added sub packages * added lerna monopackage management * check for package is instance * added method, subscription and utils package * moved almost all packages * moved all packages, no umbrella package yet * added extend to packages * made contract pass * made batch tests pass * expose providers * fixed test async * fixed test errors * fixed test event encode decode * fixed test formatter tests * fixed method tests * fixed method utils * fixed some eth methods * fixed some eth methods 2 * bumped version 0.18.3 to republish meteor package * fixed get* tests * fixed subscribe tests * added newBlockHeaders subscription * remove unpublished package from package.json * added sendTransaction test * fixed call test * moved files to done * changed extend * added iban tests * Fixed ALL tests * Fixed lint tests * Fixed contract tests * added method tests * added more method tests to test promiEvents extensively * added confirmation event * improved method confirmation checking
22 lines
971 B
JavaScript
22 lines
971 B
JavaScript
var chai = require('chai');
|
||
var utils = require('../packages/web3-utils');
|
||
|
||
var assert = chai.assert;
|
||
|
||
var tests = [
|
||
{ value: '0x6d79537472696e67', expected: 'myString'},
|
||
{ value: '0x6d79537472696e6700', expected: 'myString\u0000'},
|
||
{ value: "0x0300000035e8c6d54c5d127c9dcebe9e1a37ab9b05321128d097590a3c100000000000006521df642ff1f5ec0c3a7aa6cea6b1e7b7f7cda2cbdf07362a85088e97f19ef94331c955c0e9321ad386428c",
|
||
expected: '\u0003\u0000\u0000\u00005èÆÕL]\u0012|ξ\u001a7«\u00052\u0011(ÐY\n<\u0010\u0000\u0000\u0000\u0000\u0000\u0000e!ßd/ñõì\f:z¦Î¦±ç·÷Í¢Ëß\u00076*
\bñùC1ÉUÀé2\u001aÓB'}
|
||
];
|
||
|
||
describe('lib/utils/utils', function () {
|
||
describe('toAscii', function () {
|
||
tests.forEach(function (test) {
|
||
it('should turn ' + test.value + ' to ' + test.expected, function () {
|
||
assert.strictEqual(utils.toAscii(test.value), test.expected);
|
||
});
|
||
});
|
||
});
|
||
});
|