"use strict";
/*
* This test is meant to test a brand new startup with NO DATA in folders at all to start with
* - Delete files in the installDir first
* */
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 path_1 = __importDefault(require("path"));
const FactorioApi_1 = require("../../src/FactorioApi");
require('dotenv').config();
function main() {
    return __awaiter(this, void 0, void 0, function* () {
        // setup directory for the 'noInstall' test
        const installDir = path_1.default.join(process.cwd(), 'tests', 'credTest');
        // init API
        yield FactorioApi_1.FactorioApi.initialize({
            dataPath: installDir,
            username: process.env.FACTORIO_USER,
            token: process.env.FACTORIO_TOKEN
        });
        // if authenticated, passed else error
        if (!FactorioApi_1.FactorioApi.isAuthenticated) {
            throw new Error(`Not authenticated!`);
        }
        // console log the test name and result
        console.log(`TestCredentialStartup: Passed`);
    });
}
main().catch((err) => {
    console.error(err);
    console.log(`TestCredentialStartup: Failed`);
    process.exit(1);
});
//# sourceMappingURL=TestCredentialStartup.js.map