Advertisement
kamal72

getUserInfo

Mar 29th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. /* global it, describe, before, after, beforeEach, afterEach */
  2. 'use strict';
  3. /*
  4.  * pastebin-js
  5.  * https://github.com/j3lte/pastebin-js
  6.  *
  7.  * Copyright (c) 2013-2017 Jelte Lagendijk
  8.  * Licensed under the MIT license.
  9.  */
  10. var chai = require('chai');
  11. var sinon = require('sinon');
  12. chai.should();
  13. var chaiAsPromised = require('chai-as-promised');
  14. chai.use(chaiAsPromised);
  15. var Q = require('q');
  16. var Pastebin = require('../bin/pastebin'),
  17.     pastebin;
  18.  
  19. var stubber = function (returnValue) {
  20.   return function (path, params) {
  21.     var deferred = Q.defer();
  22.     deferred.resolve(returnValue);
  23.     return deferred.promise;
  24.   };
  25. };
  26.  
  27. // BASIC TESTS
  28. describe('Pastebin :: createPaste', function () {
  29.  
  30.     // afterEach(function () {
  31.     //   console.log('restore');
  32.     //   pastebin._postApi.restore();
  33.     // });
  34.     //
  35.     // pastebin = new Pastebin({
  36.     //   'api_dev_key' : '$api_dev_key',
  37.     //   // '\$api_user_key' : 'User',
  38.     //   // '$api_user_password' : 'Password'
  39.     // });
  40.     //
  41.     // it('reject with error in API user key length', function () {
  42.     //   sinon.stub(pastebin, '_postApi', stubber('$xxxxx-user-key'));
  43.     //   return pastebin.getUserInfo().should.be.rejectedWith('Error in createAPIuserKey! $xxxx-user-key');
  44.     // });
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement