-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
/* global gt */ | ||
gt.module('clean-version'); | ||
// gt.module('clean-version'); | ||
|
||
var clean = require('../clean-version'); | ||
// var clean = require('../clean-version'); | ||
|
||
gt.test('basic', function () { | ||
gt.arity(clean, 3, 'function expecting N arguments'); | ||
}); | ||
// gt.test('basic', function () { | ||
// gt.arity(clean, 3, 'function expecting N arguments'); | ||
// }); | ||
|
||
gt.test('clean 1.2.0', function () { | ||
var cleaned = clean('1.2.0', 'mocha'); | ||
gt.string(cleaned, 'returns a string'); | ||
gt.equal(cleaned, '1.2.0', 'version is already clean'); | ||
}); | ||
// gt.test('clean 1.2.0', function () { | ||
// var cleaned = clean('1.2.0', 'mocha'); | ||
// gt.string(cleaned, 'returns a string'); | ||
// gt.equal(cleaned, '1.2.0', 'version is already clean'); | ||
// }); | ||
|
||
gt.test('clean version with 2 digits', function () { | ||
var cleaned = clean('~1.8', 'mocha'); | ||
gt.string(cleaned, 'returns a string'); | ||
gt.equal(cleaned, '1.8.0', 'adds zero'); | ||
}); | ||
// gt.test('clean version with 2 digits', function () { | ||
// var cleaned = clean('~1.8', 'mocha'); | ||
// gt.string(cleaned, 'returns a string'); | ||
// gt.equal(cleaned, '1.8.0', 'adds zero'); | ||
// }); | ||
|
||
gt.test('clean latest versions', function () { | ||
// TODO use console.pop to grab output and check for error message | ||
var cleaned = clean('latest', 'gt'); | ||
gt.undefined(cleaned, 'returns undefined when cannot clean'); | ||
}); | ||
// gt.test('clean latest versions', function () { | ||
// // TODO use console.pop to grab output and check for error message | ||
// var cleaned = clean('latest', 'gt'); | ||
// gt.undefined(cleaned, 'returns undefined when cannot clean'); | ||
// }); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const available = require('../..') | ||
const la = require('lazy-ass') | ||
|
||
/* eslint-env mocha */ | ||
it('deps-ok', function () { | ||
la(available.length === 2) | ||
return available({ | ||
name: 'deps-ok' | ||
}).then(function (info) { | ||
la(info.name === 'deps-ok') | ||
}) | ||
}) | ||
|
||
it('deps-ok with version', function () { | ||
return available({ | ||
name: 'deps-ok', | ||
version: '1.0.0' | ||
}).then(function (info) { | ||
la(info.name === 'deps-ok') | ||
}) | ||
}) | ||
|
||
it('@bahmutov/csv with scope', function () { | ||
return available({ | ||
name: '@bahmutov/csv' | ||
}).then(function (info) { | ||
la(info.name === '@bahmutov/csv') | ||
}) | ||
}) | ||
|
||
la('deps-ok as string', function () { | ||
return available('deps-ok') | ||
.then(function (info) { | ||
la(info.name === 'deps-ok') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.