Created
February 29, 2016 22:50
-
-
Save MylesBorins/7906972dac06b3717ab8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var test = require('tap').test; | |
var rewire = require('rewire'); | |
var npmTest = rewire('../lib/npm/test'); | |
var authorName = npmTest.__get__('authorName'); | |
test('npm.test() authorName:', function (t) { | |
var name = 'titus'; | |
var author = { | |
name: 'Randy Savage', | |
email: '[email protected]', | |
url: 'omg.html' | |
}; | |
var authorExpected = 'Randy Savage <[email protected]> (omg.html)'; | |
t.equals(authorName(name), name, 'it should return any string'); | |
t.equals(authorName(author), authorExpected, 'it should return the expected string when given an object') | |
t.end(); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment