diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000000000000000000000000000000000000..6b6a9ee2e8fb2fa5909e6ae4993fd5acb4d9450d --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "es2017" + ] +} diff --git a/package.json b/package.json index 30472820b881ddbfae493a73e4a14d5e22e6a5f0..73574538bc7f004777184c8728da895add8ae942 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,14 @@ "ws": "^1.1.1" }, "devDependencies": { + "babel-polyfill": "^6.13.0", + "babel-preset-es2017": "^6.14.0", + "babel-register": "^6.14.0", + "bluebird": "^3.4.6", "browserify": "^13.0.1", "bufferutil": "^1.2.1", + "mocha": "^3.0.2", + "should": "^11.1.0", "uglifyjs": "^2.4.10", "utf-8-validate": "^1.2.1" }, diff --git a/test/api.test.js b/test/api.test.js new file mode 100644 index 0000000000000000000000000000000000000000..a555a015eef08d78f53dccad6ed76231093a3947 --- /dev/null +++ b/test/api.test.js @@ -0,0 +1,23 @@ +const Promise = require('bluebird'); +const should = require('should'); + +const Steem = require('..'); +Promise.promisifyAll(Steem.api); + +describe('getFollowers', () => { + describe('getting ned\'s followers', () => { + it('works', async () => { + const result = await Steem.api.getFollowersAsync('ned', 0, 'blog', 5) + result.should.have.lengthOf(5); + }); + + it.skip('the startFollower parameter has an impact on the result', async () => { + // Get the first 5 + const result1 = await Steem.api.getFollowersAsync('ned', 0, 'blog', 5) + result1.should.have.lengthOf(5); + const result2 = await Steem.api.getFollowersAsync('ned', 5, 'blog', 5) + result2.should.have.lengthOf(5); + result1.should.not.be.eql(result2); + }); + }); +});