Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
var server = {
startInEditMode: (function (prim) {
return Testkit$1.startInEditMode(prim);
}),
startInCloneMode: (function (prim) {
return Testkit$1.startInCloneMode(prim);
})
};
var localTestkit = {
initSite: initSite,
server: server,
siteCreators: CorvidLocalTestUtils.siteCreators,
localSiteBuilder: Testkit.localSiteBuilder
};
var $$default = localTestkit;
exports.localTestkit = localTestkit;
exports.$$default = $$default;
exports.default = $$default;
exports.__esModule = true;
/* localTestkit Not a pure module */
await fs.move(siteSrcPath, snapshotFolder);
await fs.emptyDir(siteSrcPath);
}
let localSite, editorServer, adminServer;
const closeAll = () =>
Promise.all([
Promise.resolve(localSite && localSite.close()),
Promise.resolve(editorServer && editorServer.close()),
Promise.resolve(adminServer && adminServer.close())
]);
try {
localSite = await initLocalSiteManager(siteSrcPath, siteBackupPath);
editorServer = await startSocketServer(DEFAULT_EDITOR_PORT, {
allowedDomains: ["editor.wix.com"].concat(
process.env.NODE_ENV === "test" ? ["localhost"] : []
)
});
adminServer = await startSocketServer(DEFAULT_ADMIN_PORT);
adminServer.io.use(adminTokenMiddleware(adminToken));
initServerApi(localSite, adminServer, editorServer, !isEdit(options));
logger.info(
getMessage("Server_Listening_Log", {
editorPort: editorServer.port,
adminPort: adminServer.port
})
localSite.getSiteDocument().catch(e => {
if (ParseError.isParseError(e)) {
notifyAdmin("parse-error", e.path);
}
throw e;
});