Skip to content

Commit

Permalink
WIP - #339 test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
tegefaulkes committed Mar 9, 2022
1 parent 1e7c72e commit 53ed916
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/bin/vaults/CommandScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CommandPolykey from '../CommandPolykey';
import * as binUtils from '../utils';
import * as binOptions from '../utils/options';
import * as binProcessors from '../utils/processors';
import { LogLevel } from '@matrixai/logger';

class CommandScan extends CommandPolykey {
constructor(...args: ConstructorParameters<typeof CommandPolykey>) {
Expand All @@ -17,7 +18,8 @@ class CommandScan extends CommandPolykey {
this.action(async (nodeId, options) => {
const { default: PolykeyClient } = await import('../../PolykeyClient');
const nodesPB = await import('../../proto/js/polykey/v1/nodes/nodes_pb');

this.logger.setLevel(LogLevel.INFO);
console.log(options);
const clientOptions = await binProcessors.processClientOptions(
options.nodePath,
options.nodeId,
Expand All @@ -26,6 +28,7 @@ class CommandScan extends CommandPolykey {
this.fs,
this.logger.getChild(binProcessors.processClientOptions.name),
);
console.log(clientOptions);
const client = await PolykeyClient.createPolykeyClient({
nodeId: clientOptions.nodeId,
host: clientOptions.clientHost,
Expand Down
8 changes: 5 additions & 3 deletions tests/bin/vaults/vaults.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NodeIdEncoded, NodeAddress, NodeInfo } from '@/nodes/types';
import type { NodeAddress, NodeIdEncoded, NodeInfo } from '@/nodes/types';
import type { VaultId, VaultName } from '@/vaults/types';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -33,7 +33,7 @@ jest.mock('@/keys/utils', () => ({
*/
describe('CLI vaults', () => {
const password = 'password';
const logger = new Logger('CLI Test', LogLevel.WARN, [new StreamHandler()]);
const logger = new Logger('CLI Test', LogLevel.INFO, [new StreamHandler()]);
let dataDir: string;
let passwordFile: string;
let polykeyAgent: PolykeyAgent;
Expand Down Expand Up @@ -100,6 +100,7 @@ describe('CLI vaults', () => {
});
});
beforeEach(async () => {
logger.setLevel(LogLevel.WARN);
vaultName = genVaultName();
command = [];
});
Expand Down Expand Up @@ -692,9 +693,10 @@ describe('CLI vaults', () => {
test.todo('test formatting of the output');
});
describe('commandScanNode', () => {
test(
test.only(
'should return the vaults names and ids of the remote vault',
async () => {
logger.setLevel(LogLevel.INFO);
let remoteOnline: PolykeyAgent | undefined;
try {
remoteOnline = await PolykeyAgent.createPolykeyAgent({
Expand Down

0 comments on commit 53ed916

Please sign in to comment.