Comparing version 0.1.3 to 0.1.4
@@ -8,3 +8,3 @@ const url = require('url') | ||
module.exports = (bytecode, apiKey, inputApiUrl = defaultApiUrl) => { | ||
const analyze = (bytecode, apiKey, inputApiUrl = defaultApiUrl) => { | ||
return new Promise((resolve, reject) => { | ||
@@ -34,1 +34,4 @@ if (bytecode === undefined) { | ||
} | ||
module.exports = analyze | ||
module.exports.analyze = analyze |
@@ -10,3 +10,3 @@ exports.do = (uuid, apiKey, apiUrl, pollStep = 1000) => { | ||
headers: { | ||
authorization: `Bearer ${apiKey}` | ||
'Authorization': `Bearer ${apiKey}` | ||
} | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "armlet", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A Mythril Platform API client.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,3 +15,3 @@ [![CircleCI](https://circleci.com/gh/fgimenez/armlet.svg?style=svg&circle-token=3794de647a820eabf62e091c80d761a722b17b0c)](https://circleci.com/gh/fgimenez/armlet) | ||
Then get the Mythril Platform analysis results with the promise returned by | ||
the `analyze` function: | ||
the exposed function: | ||
```javascript | ||
@@ -18,0 +18,0 @@ const analyze = require('armlet') |
@@ -1,2 +0,3 @@ | ||
const analyze = require('../index') | ||
const armlet = require('../index') | ||
const { analyze } = require('../index') | ||
const sinon = require('sinon') | ||
@@ -15,3 +16,3 @@ const url = require('url') | ||
describe('#analyze', () => { | ||
describe('#armlet', () => { | ||
afterEach(() => { | ||
@@ -31,7 +32,7 @@ requester.do.restore() | ||
it('should be a function', () => { | ||
analyze.should.be.a('function') | ||
armlet.should.be.a('function') | ||
}) | ||
it('should return a thenable', () => { | ||
const result = analyze(bytecode, apiKey) | ||
const result = armlet(bytecode, apiKey) | ||
@@ -42,12 +43,36 @@ result.then.should.be.a('function') | ||
it('should require a bytecode param', async () => { | ||
await analyze(undefined, apiKey).should.be.rejectedWith(TypeError) | ||
await armlet(undefined, apiKey).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require an apiKey param', async () => { | ||
await analyze(bytecode).should.be.rejectedWith(TypeError) | ||
await armlet(bytecode).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require a valid api URL if given', async () => { | ||
await analyze(bytecode, apiKey, 'not-a-real-url').should.be.rejectedWith(TypeError) | ||
await armlet(bytecode, apiKey, 'not-a-real-url').should.be.rejectedWith(TypeError) | ||
}) | ||
describe('#analyze', () => { | ||
it('should be function', () => { | ||
analyze.should.be.a('function') | ||
}) | ||
it('should return a thenable', () => { | ||
const result = analyze(bytecode, apiKey) | ||
result.then.should.be.a('function') | ||
}) | ||
it('should require a bytecode param', async () => { | ||
await analyze(undefined, apiKey).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require an apiKey param', async () => { | ||
await analyze(bytecode).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require a valid api URL if given', async () => { | ||
await analyze(bytecode, apiKey, 'not-a-real-url').should.be.rejectedWith(TypeError) | ||
}) | ||
}) | ||
}) | ||
@@ -54,0 +79,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19866
508