UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

27 lines 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const stream_package_to_cache_1 = require("./stream-package-to-cache"); const get_random_string_1 = require("../util/get-random-string"); const js_spawner_1 = require("../spawner/js-spawner"); const path_1 = require("path"); const tempy = require("tempy"); const package_stream_from_cache_1 = require("./package-stream-from-cache"); const package_stream_from_cwd_1 = require("./package-stream-from-cwd"); describe(__dirname, () => { it('downloads models from the cloud', () => { // TODO }); it('reads and writes models locally', async () => { const id = `${get_random_string_1.getRandomString()}/${get_random_string_1.getRandomString()}`; const version = get_random_string_1.getRandomString(); const cwd = __dirname; const fromCwd = await package_stream_from_cwd_1.PackageStreamFromCwd({ cwd }); await stream_package_to_cache_1.streamPackageToCache({ id, version, readable: fromCwd }); const target = js_spawner_1.JsSpawner({ path: tempy.directory() }); const fromCache = await package_stream_from_cache_1.PackageStreamFromCache({ id, version }); await target.untar(fromCache); const fileNames = await target.readdir(); expect(fileNames).toEqual([path_1.basename(__dirname)]); }); }); //# sourceMappingURL=index.test.js.map