"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const util_1 = require("util");
const common_1 = require("./common");
const access = (0, util_1.promisify)(fs_1.default.access);
describe('Apps', () => {
    it('should have a "logo.png"', () => __awaiter(void 0, void 0, void 0, function* () {
        const appIds = (0, common_1.getAllAppIds)();
        const logoExists = yield Promise.all(appIds.map((app) => __awaiter(void 0, void 0, void 0, function* () {
            const path = 'src/apps/' + app + '/assets/logo.png';
            return access(path)
                .then(() => true)
                .catch(() => false);
        })));
        const appsMissingLogos = appIds.filter((t, i) => !logoExists[i]);
        expect(appsMissingLogos, `${appsMissingLogos.join(', ')} do not have "logo.png"`).toHaveLength(0);
    }));
});
//# sourceMappingURL=apps.assets.test.js.map