Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] fixed change in labels parsed from nsc #28

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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