Skip to content

Commit

Permalink
[TEST] fixed change in labels parsed from nsc (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart authored Oct 12, 2023
1 parent c95f223 commit c5e42a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/nsc_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Deno.test("nsc - env", async () => {
const std = await nsc.env();
const table = parseTable(std.err);
const nscHome = table.find((v) => {
return v[0] === "$NSC_HOME";
return v[0] === "$NSC_HOME (deprecated)";
})?.[2];
if (nscHome) {
assertEquals(homeDir(nscHome), join(getConfigHome(), "nats", "nsc"));
}

const nkeys = table.find((v) => {
return v[0] === "$NKEYS_PATH";
return v[0] === "$NKEYS_PATH (deprecated)";
});
const nkeysPath = nkeys?.[2];
assertEquals(homeDir(nkeysPath), getKeysDir());
Expand All @@ -56,13 +56,13 @@ Deno.test("nsc - set env nkeys_path", async () => {
const std = await nsc.env();
const table = parseTable(std.err);
const nscHome = table.find((v) => {
return v[0] === "$NSC_HOME";
return v[0] === "$NSC_HOME (deprecated)";
})?.[2];
assertEquals(homeDir(nscHome), join(getConfigHome(), "nats", "nsc"));
assert(nscHome?.includes("my_test_"));

const nkeys = table.find((v) => {
return v[0] === "$NKEYS_PATH";
return v[0] === "$NKEYS_PATH (deprecated)";
});
const nkeysPath = nkeys?.[2];
assertEquals(homeDir(nkeysPath), nkeysDir);
Expand All @@ -84,15 +84,16 @@ Deno.test("nsc - set nkeys dir", async () => {
setNscConfig(join(dir, "config"));

const std = await nsc.env();

const table = parseTable(std.err);
const nscHome = table.find((v) => {
return v[0] === "$NSC_HOME";
return v[0] === "$NSC_HOME (deprecated)";
})?.[2];
assertEquals(nscHome, join(getConfigHome(), "nats", "nsc"));
assert(nscHome?.includes("my_test_"));

const nkeys = table.find((v) => {
return v[0] === "$NKEYS_PATH";
return v[0] === "$NKEYS_PATH (deprecated)";
});
const nkeysPath = nkeys?.[2];
assertEquals(nkeysPath, getKeysDir());
Expand Down

0 comments on commit c5e42a2

Please sign in to comment.