Adjust test expectations (#5490)

This commit is contained in:
Jaco
2023-02-16 21:10:17 +02:00
committed by GitHub
parent 5cbe80066d
commit b8233fb7b8
10 changed files with 30 additions and 22 deletions
@@ -81,7 +81,7 @@ describe('BTreeMap', (): void => {
(): BTreeMap<Text, U32> => new (
BTreeMap.with(Text, U32)
)(registry, 'ABC')
).toThrowError(/Map: cannot decode type/);
).toThrow(/Map: cannot decode type/);
});
it('correctly encodes length', (): void => {
@@ -123,7 +123,7 @@ describe('BTreeSet', (): void => {
(): BTreeSet<U32> => new (
BTreeSet.with(U32)
)(registry, 'ABC')
).toThrowError(/BTreeSet: cannot decode type/);
).toThrow(/BTreeSet: cannot decode type/);
});
describe('enocodedLength & initialU8aLength', (): void => {
@@ -134,7 +134,7 @@ describe('Struct', (): void => {
u32: U32
})
)(registry, 'ABC')
).toThrowError(/Cannot decode value/);
).toThrow(/Cannot decode value/);
});
it('throws a sensical error on incorrect array values passed to structs', (): void => {
+5 -5
View File
@@ -42,14 +42,14 @@ ${formatFixed(micro).padStart(NUM_PAD + PRE_PAD + 1)} μs/op`;
}
export function perf (name: string, count: number, inputs: unknown[][], exec: ExecFn): void {
if (process.env.GITHUB_REPOSITORY) {
return;
}
const test = process.env.GITHUB_REPOSITORY
? it.skip
: it;
it(`performance: ${name}`, (): void => {
test(`performance: ${name}`, (): void => {
const [time] = loop(count, inputs, exec);
console.log(`
console.error(`
performance run for ${name} completed with ${formatNumber(count)} iterations.
${`${name}:`.padStart(PRE_PAD)} ${time.toFixed(2).padStart(NUM_PAD)} ms${formatOps(count, time)}