Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
acuarica committed Dec 17, 2024
1 parent b30f0d3 commit baa2879
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/__snapshots__/bin.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ url ipfs://QmQaEuFFsAwGbKd51LPcsLkKD5NwsB8aAzg7KkRsjuhjf2
```

```out display-Cannot-find-bytecode-for-contract---when-there-is-no-stdin-attached
Cannot find bytecode for contract -
```

```out display-no-metadata-from-bytecode
Contract Metadata
No metadata
Expand Down
8 changes: 8 additions & 0 deletions test/bin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ describe('::bin', function () {
expect(cli).to.exit.with.code(0);
});

it('should display `Cannot find bytecode for contract -` when there is no `stdin` attached', function () {
const cli = chaiExec(sevm, ['metadata', '-', '--no-color', '--no-patch']);

expect(cli).stdout.to.be.empty;
expect(cli.stderr).to.matchSnapshot('out', this);
expect(cli).to.exit.with.code(2);
});

it('should display no-`metadata` from `bytecode`', function () {
const input = '60806040525f80fdfe';
const cli = chaiExec(sevm, ['metadata', '-', '--no-color', '--no-patch'], { input });
Expand Down

0 comments on commit baa2879

Please sign in to comment.