authelia/scripts/utils/ListSuites.js

13 lines
376 B
JavaScript
Raw Normal View History

const { lstatSync, readdirSync } = require('fs')
const { join } = require('path')
const isDirectory = source => lstatSync(source).isDirectory()
const getDirectories = source =>
readdirSync(source)
.map(name => join(source, name))
.filter(isDirectory)
.map(x => x.split('/').slice(-1)[0])
module.exports = function() {
return getDirectories('test/suites/');
}