Skip to content

Commit

Permalink
Fix CLI --version test to use version from the binary not `package.…
Browse files Browse the repository at this point in the history
…json`
  • Loading branch information
cameel committed May 19, 2022
1 parent c23b697 commit 2134a08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/cli.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import tape from 'tape';
import spawn from 'tape-spawn';
import * as path from 'path';
const pkg = require('../package.json');
import solc from '../';

tape('CLI', function (t) {
t.test('--version', function (st) {
const spt = spawn(st, './solc.js --version');
spt.stdout.match(RegExp(pkg.version + '(-[^a-zA-A0-9.+]+)?(\\+[^a-zA-Z0-9.-]+)?'));
spt.stdout.match(solc.version() + "\n");
spt.stdout.match(RegExp('[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9.]+)?\\+commit\\.[0-9a-f]+([a-zA-Z0-9.-]+)?'));
spt.stderr.empty();
spt.end();
});
Expand Down

0 comments on commit 2134a08

Please sign in to comment.