Skip to content

Commit

Permalink
Test that aliases are properly created
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinND committed Jun 25, 2014
1 parent 8492591 commit cb7c30d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 24 additions & 0 deletions test/aliases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

require('should');

var Anyfetch = require('../lib/index.js');
var configuration = require('../config/configuration.js');

/**
* @file Test that all aliases refer to their original function
*/
describe('<aliases>', function() {
var aliases = configuration.aliases;
var anyfetch = new Anyfetch(configuration.test.login, configuration.test.password);

Object.keys(aliases).forEach(function(newName) {
var oldName = aliases[newName];
describe(newName + ' <-- ' + oldName, function() {
it('should refer to the same function', function() {
anyfetch[newName].should.equal(anyfetch[oldName]);
});
});
});

});
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ var Anyfetch = require('../lib/index.js');
var configuration = require('../config/configuration.js');
var isFunction = require('../lib/helpers/is-function.js');

// TODO: test all aliases

describe('<Anyfetch library API mapping functions>', function() {
var accessToken;
var anyfetchBasic = new Anyfetch(configuration.test.login, configuration.test.password);
Expand Down

0 comments on commit cb7c30d

Please sign in to comment.