Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Fixed bin/rlp CLI command bug #60

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/rlp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const rlp = require('./dist/index.js')
const rlp = require('../dist/index.js')
const command = process.argv[2]
var raw = process.argv[3]

Expand Down
11 changes: 3 additions & 8 deletions test/integration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as assert from 'assert'
import { exec } from 'child_process'
import * as RLP from '../dist'

describe('Distribution:', function() {
Expand All @@ -9,16 +10,10 @@ describe('Distribution:', function() {
})
})

/*
describe('CLI command:', function() {
it('should be able to run CLI command', function() {
const execP = util.promisify(exec)

async function bin() {
const { stdout, stderr } = await execP('./bin/rlp encode "[ 5 ]"')
exec('./bin/rlp encode "[ 5 ]"', (_error, stdout, _stderr) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I was running into linting errors like 'error' is declared but its value is never read here, however I didn't want to explicitly handle error and stuff here, so I googled towards the underscore solution. Is this a good way to do it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I do this like this myself. Furthermore: _stderr could be deleted entirely since it's the last parameter.

assert.equal(stdout.trim(), 'c105')
}
bin()
})
})
})
*/