Comparing version 0.1.4 to 0.1.5
@@ -8,3 +8,3 @@ const url = require('url') | ||
const analyze = (bytecode, apiKey, inputApiUrl = defaultApiUrl) => { | ||
module.exports = (bytecode, apiKey, inputApiUrl = defaultApiUrl) => { | ||
return new Promise((resolve, reject) => { | ||
@@ -34,4 +34,1 @@ if (bytecode === undefined) { | ||
} | ||
module.exports = analyze | ||
module.exports.analyze = analyze |
{ | ||
"name": "armlet", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A Mythril Platform API client.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,3 +0,2 @@ | ||
const armlet = require('../index') | ||
const { analyze } = require('../index') | ||
const analyze = require('../index') | ||
const sinon = require('sinon') | ||
@@ -31,7 +30,7 @@ const url = require('url') | ||
it('should be a function', () => { | ||
armlet.should.be.a('function') | ||
analyze.should.be.a('function') | ||
}) | ||
it('should return a thenable', () => { | ||
const result = armlet(bytecode, apiKey) | ||
const result = analyze(bytecode, apiKey) | ||
@@ -42,36 +41,12 @@ result.then.should.be.a('function') | ||
it('should require a bytecode param', async () => { | ||
await armlet(undefined, apiKey).should.be.rejectedWith(TypeError) | ||
await analyze(undefined, apiKey).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require an apiKey param', async () => { | ||
await armlet(bytecode).should.be.rejectedWith(TypeError) | ||
await analyze(bytecode).should.be.rejectedWith(TypeError) | ||
}) | ||
it('should require a valid api URL if given', async () => { | ||
await armlet(bytecode, apiKey, 'not-a-real-url').should.be.rejectedWith(TypeError) | ||
await analyze(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) | ||
}) | ||
}) | ||
}) | ||
@@ -78,0 +53,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
19016
487