Skip to content

Commit

Permalink
Simplified absolute path tests between platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Antyos committed Apr 2, 2020
1 parent acc029c commit 17594d5
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,35 +130,18 @@ describe('commandExists', function(){
});

describe('absolute path', function() {
if (!isUsingWindows) {
it('it should report true if there is a command with that name in absolute path', function(done) {
var commandToUse = resolve('test/executable-script.js');
commandExists(commandToUse)
.then(function(command){
expect(command).to.be(commandToUse);
done();
});
});

it('it should report false if there is not a command with that name in absolute path', function() {
var commandToUse = resolve('executable-script.js');
expect(commandExists.sync(commandToUse)).to.be(false);
});
}
if (isUsingWindows) {
it('it should report true if there is a command with that name in absolute path', function(done) {
var commandToUse = resolve('test\\executable-script.cmd');
commandExists(commandToUse)
.then(function(command){
expect(command).to.be(commandToUse);
done();
});
});

it('it should report false if there is not a command with that name in absolute path', function() {
var commandToUse = resolve('executable-script.cmd');
expect(commandExists.sync(commandToUse)).to.be(false);
it('it should report true if there is a command with that name in absolute path', function(done) {
var commandToUse = resolve('test/executable-script.js');
commandExists(commandToUse)
.then(function(command){
expect(command).to.be(commandToUse);
done();
});
}
});

it('it should report false if there is not a command with that name in absolute path', function() {
var commandToUse = resolve('executable-script.js');
expect(commandExists.sync(commandToUse)).to.be(false);
});
});
});

0 comments on commit 17594d5

Please sign in to comment.