diff --git a/.github/workflows/delete-packages-and-releases.yml b/.github/workflows/delete-packages-and-releases.yml index 80ca0d8c..3d8cd83d 100644 --- a/.github/workflows/delete-packages-and-releases.yml +++ b/.github/workflows/delete-packages-and-releases.yml @@ -7,9 +7,6 @@ on: description: 'Tag to delete' required: true type: string - secrets: - GITHUB_TOKEN: - required: true workflow_dispatch: inputs: tag: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f0654a0e..ae89eff2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,5 +21,4 @@ jobs: packages: write # For publishing packages uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/release.yml@abe950ede3b052dfc236f730cf11cc290af53d1c secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eefbd17a..53f58f1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,6 @@ on: default: true type: boolean secrets: - GITHUB_TOKEN: - required: true ECHO_LIBRARIES_ACCESS_KEY: required: true workflow_dispatch: @@ -65,8 +63,6 @@ jobs: uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/delete-packages-and-releases.yml@abe950ede3b052dfc236f730cf11cc290af53d1c with: tag: ${{ inputs.jsTag }} - secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: inputs.dev == true release: name: Release JavaScript Wrapper diff --git a/src/tests/LoggerConfigTest.test.ts b/src/tests/LoggerConfigTest.test.ts new file mode 100644 index 00000000..c3f4cd9b --- /dev/null +++ b/src/tests/LoggerConfigTest.test.ts @@ -0,0 +1,26 @@ +import { getLoggerWithFilePath, logger } from '../main/wrapper/loggerConfig'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('Logger Configuration', () => { + it('should initialize logger with file path', () => { + const tempDir = path.join(__dirname, '../../tmp'); + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }); + } + + const logFilePath = path.join(tempDir, 'test.log'); + + // This should call configurationWithFile and cover line 4 + getLoggerWithFilePath(logFilePath); + + expect(logger).toBeDefined(); + }); + + it('should initialize logger without file path', () => { + // This should call configurationWithoutFile + getLoggerWithFilePath(); + + expect(logger).toBeDefined(); + }); +});