Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Dec 20, 2024
1 parent a9059fe commit 0109176
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion commands/project/__tests__/logs.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// @ts-nocheck
const yargs = require('yargs');
const { addUseEnvironmentOptions } = require('../../../lib/commonOpts');
const ProjectLogsManager = require('../../../lib/projects/ProjectLogsManager');
const {
ProjectLogsManager,
} = require('../../../lib/projects/ProjectLogsManager');
const {
projectLogsPrompt,
} = require('../../../lib/prompts/projectsLogsPrompt');
Expand Down
2 changes: 1 addition & 1 deletion commands/project/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { uiBetaTag, uiLine, uiLink } = require('../../lib/ui');
const { projectLogsPrompt } = require('../../lib/prompts/projectsLogsPrompt');
const { i18n } = require('../../lib/lang');
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
const ProjectLogsManager = require('../../lib/projects/ProjectLogsManager');
const { ProjectLogsManager } = require('../../lib/projects/ProjectLogsManager');

const i18nKey = 'commands.project.subcommands.logs';

Expand Down
8 changes: 4 additions & 4 deletions lib/__tests__/ProjectLogsManager.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
const ProjectLogsManager = require('../projects/ProjectLogsManager');
const { ProjectLogsManager } = require('../projects/ProjectLogsManager');
const { getProjectConfig, ensureProjectExists } = require('../projects');
const {
fetchProjectComponentsMetadata,
Expand Down Expand Up @@ -143,8 +143,8 @@ describe('lib/projects/ProjectLogsManager', () => {
});

describe('getFunctionNames', () => {
it('should return an empty array if functions is nullable', async () => {
ProjectLogsManager.functions = undefined;
it('should return an empty array if functions is empty', async () => {
ProjectLogsManager.functions = [];
expect(ProjectLogsManager.getFunctionNames()).toEqual([]);
});

Expand All @@ -159,7 +159,7 @@ describe('lib/projects/ProjectLogsManager', () => {

describe('setFunction', () => {
it('should throw an error when functions is nullable', async () => {
ProjectLogsManager.functions = undefined;
ProjectLogsManager.functions = [];
expect(() => ProjectLogsManager.setFunction('foo')).toThrow(
`There aren't any functions in this project`
);
Expand Down
4 changes: 2 additions & 2 deletions lib/projects/ProjectLogsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { uiLink } from '../ui';

const i18nKey = 'commands.project.subcommands.logs';

class ProjectLogsManager {
class _ProjectLogsManager {
projectName: string | undefined;
projectId: number | undefined;
accountId: number | undefined;
Expand Down Expand Up @@ -153,4 +153,4 @@ class ProjectLogsManager {
}
}

export default new ProjectLogsManager();
export const ProjectLogsManager = new _ProjectLogsManager();

0 comments on commit 0109176

Please sign in to comment.