Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5678 from karol-bujacek/bugfix/deploy-ecosystem-f…
…ilename-extension Bugfix/deploy ecosystem filename extension
- Loading branch information
Showing
4 changed files
with
74 additions
and
15 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
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,43 @@ | ||
var Common = require('../../lib/Common'); | ||
var should = require('should'); | ||
|
||
process.chdir(__dirname); | ||
|
||
describe('Common utilities', function () { | ||
describe('Config file detection', function () { | ||
var tests = [ | ||
{ arg: "ecosystem.json", expected: "json" }, | ||
{ arg: "ecosystem.yml", expected: "yaml" }, | ||
{ arg: "ecosystem.yaml", expected: "yaml" }, | ||
{ arg: "ecosystem.config.js", expected: "js" }, | ||
{ arg: "ecosystem.config.cjs", expected: "js" }, | ||
{ arg: "ecosystem.config.mjs", expected: "mjs" }, | ||
] | ||
|
||
tests.forEach(function (test) { | ||
it('should accept configuration file ' + test.arg , function () { | ||
var result = Common.isConfigFile(test.arg); | ||
should(result).eql(test.expected); | ||
}) | ||
}); | ||
|
||
it('should not accept unknown filename', function () { | ||
should(Common.isConfigFile('lorem-ipsum.js')).be.null(); | ||
}) | ||
}) | ||
|
||
describe('Config file candidates', function () { | ||
it('should return an array with well-known file extensions', function () { | ||
var result = Common.getConfigFileCandidates('ecosystem'); | ||
should(result).eql([ | ||
'ecosystem.json', | ||
'ecosystem.yml', | ||
'ecosystem.yaml', | ||
'ecosystem.config.js', | ||
'ecosystem.config.cjs', | ||
'ecosystem.config.mjs' | ||
]); | ||
}); | ||
}); | ||
|
||
}) |
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