UNPKG

@platform/react.ssr

Version:

A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.

43 lines (42 loc) 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.testManifestDef = exports.testManifest = exports.YAML_MANIFEST = exports.YAML_DIR = void 0; var tslib_1 = require("tslib"); tslib_1.__exportStar(require("@platform/test"), exports); tslib_1.__exportStar(require("../common"), exports); var common_1 = require("../common"); var manifest_1 = require("../manifest"); exports.YAML_DIR = common_1.fs.resolve('src/test/yml'); exports.YAML_MANIFEST = common_1.fs.join(exports.YAML_DIR, 'manifest.yml'); var url = 'https://sfo2.digitaloceanspaces.com/platform/modules/react.ssr/manifest.yml'; function testManifest(filename) { if (filename === void 0) { filename = 'manifest.yml'; } return tslib_1.__awaiter(this, void 0, void 0, function () { var path; return tslib_1.__generator(this, function (_a) { path = common_1.fs.join(exports.YAML_DIR, filename); return [2, manifest_1.Manifest.fromFile({ path: path, baseUrl: url })]; }); }); } exports.testManifest = testManifest; function testManifestDef(filename) { if (filename === void 0) { filename = 'manifest.yml'; } return tslib_1.__awaiter(this, void 0, void 0, function () { var path, def; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: path = common_1.fs.join(exports.YAML_DIR, filename); return [4, common_1.fs.file.loadAndParse(path)]; case 1: def = _a.sent(); return [2, def]; } }); }); } exports.testManifestDef = testManifestDef; after(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2, common_1.fs.remove(common_1.fs.resolve('tmp'))]; }); }); });