Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/unit/environment.test.ts
6449 views
1
/*
2
* environment.test.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*
6
*/
7
import { assert, assertEquals } from "testing/asserts";
8
import { getenv } from "../../src/core/env.ts";
9
import { pandocBinaryPath, resourcePath } from "../../src/core/resources.ts";
10
import { unitTest } from "../test.ts";
11
12
unitTest(
13
"environment",
14
//deno-lint-ignore require-await
15
async () => {
16
const d = "B4CE1323-5ED7-43A8-AEF0-4409F42CF3C8";
17
const path = getenv("D684CD56-D4DF-476D-ACB7-7E5D404BC743", d);
18
assertEquals(
19
path,
20
d,
21
"Incorrect default path returned",
22
);
23
assert(
24
pandocBinaryPath().length > 0,
25
"Unable to get path using binaryPath()",
26
);
27
28
assert(
29
resourcePath("metadata.template").length > 0,
30
"Unable to get path using resourcePath('metadata.template')",
31
);
32
},
33
);
34
35