mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Fixed a test failing due to a .DS_Store file
no refs - When a `.DS_Store` file was present, the code wasn't ignoring the `README.md` anymore. I've fixed it with a for+while nested loops.
This commit is contained in:
parent
a1421c2380
commit
e17446456e
@ -162,11 +162,11 @@ describe('Themes API', function () {
|
||||
|
||||
// ensure tmp theme folder contains one theme again now
|
||||
const tmpFolderContents = fs.readdirSync(config.getContentPath('themes'));
|
||||
tmpFolderContents.forEach((theme, index) => {
|
||||
if (theme.match(/^\./) || theme === 'README.md') {
|
||||
tmpFolderContents.splice(index, 1);
|
||||
for (let i = 0; i < tmpFolderContents.length; i++) {
|
||||
while (tmpFolderContents[i].match(/^\./) || tmpFolderContents[i] === 'README.md') {
|
||||
tmpFolderContents.splice(i, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
tmpFolderContents.should.be.an.Array().with.lengthOf(10);
|
||||
|
||||
tmpFolderContents.should.eql([
|
||||
|
Loading…
Reference in New Issue
Block a user