This commit is contained in:
Jaco
2022-03-23 07:19:33 +02:00
committed by GitHub
parent 31e7de31f3
commit e573c26df3
6 changed files with 71 additions and 65 deletions
+3 -1
View File
@@ -36,7 +36,9 @@ describe('replay', (): void => {
const observable = rpc.system.chain();
let a: any | undefined;
observable.subscribe((value?: unknown): void => { a = value; });
observable.subscribe((value?: unknown): void => {
a = value;
});
setTimeout((): void => {
// Subscribe again to the same observable, it should fire value immediately
+3 -1
View File
@@ -14,7 +14,9 @@ describe('drr', (): void => {
it('should not fire twice the same value', (done): void => {
let count = 0;
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => { ++count; });
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => {
++count;
});
setTimeout((): void => {
expect(count).toBe(1);
+1 -1
View File
@@ -46,7 +46,7 @@
"@polkadot/x-ws": "^8.6.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.3.1"
"yargs": "^17.4.0"
},
"devDependencies": {
"@types/websocket": "^1.0.5",
+3 -1
View File
@@ -23,7 +23,9 @@ describe('Text', (): void => {
testDecode('Raw', new Raw(registry, Uint8Array.from([102, 111, 111])), 'foo', 'toHuman'); // no length
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo'); // length-aware encoding
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo', 'toHuman'); // length-aware encoding
testDecode('object with `toString()`', { toString (): string { return 'foo'; } }, 'foo');
testDecode('object with `toString()`', { toString (): string {
return 'foo';
} }, 'foo');
testDecode('hex input value', new Text(registry, '0x12345678'), '0x12345678', 'toHex');
testDecode('null', null, '');
});