From ca438b8605924086b9200189eaaf16cc4d99988b Mon Sep 17 00:00:00 2001 From: "Angel M. Adames" Date: Wed, 13 Mar 2024 07:30:45 -0400 Subject: [PATCH] chore: Fix Biome lint warnings --- biome.json | 2 +- src/config/env.ts | 4 +- src/utils/compose.ts | 4 +- test/commands/compose.test.ts | 47 -------------------- test/commands/config.current-project.test.ts | 2 +- 5 files changed, 6 insertions(+), 53 deletions(-) delete mode 100644 test/commands/compose.test.ts diff --git a/biome.json b/biome.json index 17ac84b..c3bbf79 100644 --- a/biome.json +++ b/biome.json @@ -7,7 +7,7 @@ "enabled": true, "rules": { "recommended": true, - "nursery": { + "correctness": { "noUnusedImports": "warn" }, "suspicious": { diff --git a/src/config/env.ts b/src/config/env.ts index 6a15795..0ab5df1 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -1,7 +1,7 @@ -import fs from 'fs'; +import * as fs from 'node:fs'; import log from '../utils/log'; import { flattenObject } from '../utils/object'; -import { type DEMSProjectConfig } from './dems'; +import type { DEMSProjectConfig } from './dems'; export const dotEnv = { generate(envFilePath: string, config: DEMSProjectConfig): void { diff --git a/src/utils/compose.ts b/src/utils/compose.ts index d56cc92..1c7828c 100644 --- a/src/utils/compose.ts +++ b/src/utils/compose.ts @@ -1,5 +1,5 @@ -import fs from 'node:fs'; -import path from 'path'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; import { projectConfig } from '../config/project'; import { cmd as $ } from './cmd'; import { isFile } from './file-system'; diff --git a/test/commands/compose.test.ts b/test/commands/compose.test.ts deleted file mode 100644 index 0c83577..0000000 --- a/test/commands/compose.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { afterAll, beforeEach, describe, expect, test } from 'bun:test'; -import { projectConfig } from '../../src/config/project'; -import { composeExecParams, composeFiles } from '../../src/utils/compose'; -import { testSetup, testTeardown } from '../lifecycle'; - -beforeEach(() => { - testSetup(); -}); - -afterAll(() => { - testTeardown(); -}); - -describe("Command: 'compose'", () => { - const config = projectConfig(); - - test('Returns compose exec params', () => { - const composeSettingsString = composeExecParams(); - expect(composeSettingsString).toContain( - `--env-file ${config.paths.env_file}`, - ); - expect(composeSettingsString).toContain( - `--project-name ${config.compose.project_name}`, - ); - }); - - test.skip('Returns compose files params', () => { - const files = composeFiles({}); - expect(files).toBeArray(); - expect(files.join(' ').split(' ')).toContain('--file'); - }); - - test.skip('Returns error when no arguments', () => { - const command = Bun.spawnSync(['./cli.ts', 'compose']); - expect(command.stdout.toString()).toContain( - 'A Compose command needs to be specified.', - ); - expect(command.exitCode).toEqual(1); - }); - - test.skip('Returns both files and exec params', () => { - const command = Bun.spawnSync(['./cli.ts', 'compose', 'show-args']); - expect(command.stdout.toString()).toContain('Compose command params:'); - expect(command.stdout.toString()).toContain('Compose files params:'); - expect(command.exitCode).toEqual(0); - }); -}); diff --git a/test/commands/config.current-project.test.ts b/test/commands/config.current-project.test.ts index 745c082..4e82419 100644 --- a/test/commands/config.current-project.test.ts +++ b/test/commands/config.current-project.test.ts @@ -9,7 +9,7 @@ const PROJECT = 'testProject'; const CURRENT_PROJECT_FILE = './current-project-test'; beforeEach(() => { - testSetup(); + // testSetup(); createFile({ file: CURRENT_PROJECT_FILE, content: 'test' }); });