UNPKG

@remotion/bundler

Version:

Bundle Remotion compositions using Webpack

22 lines (21 loc) 1.52 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const bun_test_1 = require("bun:test"); const node_path_1 = __importDefault(require("node:path")); const validate_public_dir_1 = require("../validate-public-dir"); (0, bun_test_1.describe)('validatePublicDir()', () => { (0, bun_test_1.test)('Should not allow root directory as public dir.', () => { (0, bun_test_1.expect)(() => (0, validate_public_dir_1.validatePublicDir)(node_path_1.default.parse(process.cwd()).root)).toThrow(/which is the root directory. This is not allowed./); }); (0, bun_test_1.test)('Should not allow a path where the parent directory does not exist', () => { const pathToPass = process.platform === 'win32' ? 'C:\\foo\\bar' : '/foo/bar'; const expectedParent = process.platform === 'win32' ? 'C:\\foo' : '/foo'; (0, bun_test_1.expect)(() => (0, validate_public_dir_1.validatePublicDir)(pathToPass)).toThrow(`The public directory was specified as "${pathToPass}", but this folder does not exist and the parent directory "${expectedParent}" does also not exist.`); }); (0, bun_test_1.test)('Should allow /foo as a path since that directory can be created', () => { (0, bun_test_1.expect)(() => (0, validate_public_dir_1.validatePublicDir)(process.platform === 'win32' ? 'C:\\foo' : '/foo')).not.toThrow(); }); });