refactor: Use endsWith for app folder path test
This commit is contained in:
@@ -8,6 +8,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|||||||
|
|
||||||
class App {
|
class App {
|
||||||
static folderPath = join(__dirname, '../apps');
|
static folderPath = join(__dirname, '../apps');
|
||||||
|
|
||||||
static list = fs
|
static list = fs
|
||||||
.readdirSync(this.folderPath)
|
.readdirSync(this.folderPath)
|
||||||
.filter((file) => fs.statSync(join(this.folderPath, file)).isDirectory());
|
.filter((file) => fs.statSync(join(this.folderPath, file)).isDirectory());
|
||||||
|
@@ -6,9 +6,7 @@ import * as appInfoConverterModule from '../helpers/app-info-converter.js';
|
|||||||
|
|
||||||
describe('App model', () => {
|
describe('App model', () => {
|
||||||
it('folderPath should return correct path', () => {
|
it('folderPath should return correct path', () => {
|
||||||
expect(App.folderPath).toEqual(
|
expect(App.folderPath.endsWith('/packages/backend/src/apps')).toBe(true);
|
||||||
expect.stringMatching(/\/packages\/backend\/src\/apps$/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('list should have list of applications keys', () => {
|
it('list should have list of applications keys', () => {
|
||||||
|
Reference in New Issue
Block a user