From 0c83deb8439c9195f5be036befe427504e3ac80c Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 14 Sep 2024 23:36:24 +0300 Subject: [PATCH] fix(build-env): fix typos --- .../src/executors/bootstrap/executor.unit-test.ts | 10 +++++----- .../bootstrap/verdaccio-registry.unit-test.ts | 10 +++++----- tooling/build-env/src/executors/setup/executor.ts | 6 +----- tooling/build-env/src/index.ts | 5 +---- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/tooling/build-env/src/executors/bootstrap/executor.unit-test.ts b/tooling/build-env/src/executors/bootstrap/executor.unit-test.ts index f0dfe702..bbf9459d 100644 --- a/tooling/build-env/src/executors/bootstrap/executor.unit-test.ts +++ b/tooling/build-env/src/executors/bootstrap/executor.unit-test.ts @@ -1,6 +1,6 @@ import runBootstrapExecutor from './executor'; import * as bootstrapEnvModule from './bootstrap-env'; -import { beforeEach, expect, vi } from 'vitest'; +import { beforeEach, expect, vi, it, describe } from 'vitest'; import { logger } from '@nx/devkit'; vi.mock('@nx/devkit', async () => { @@ -55,13 +55,13 @@ describe('runBootstrapExecutor', () => { ) ).resolves.toStrictEqual({ success: true, - command: 'Bootstraped environemnt successfully.', + command: 'Bootstraped environment successfully.', }); expect(logger.error).not.toHaveBeenCalled(); expect(logger.info).toHaveBeenCalledTimes(1); expect(logger.info).toHaveBeenCalledWith( - 'Execute @org/build-env:build with options: {}' + 'Execute @org/build-env:bootstrap with options: {}' ); expect(bootstrapEnvironmentSpy).toHaveBeenCalledTimes(1); @@ -96,7 +96,7 @@ describe('runBootstrapExecutor', () => { ) ).resolves.toStrictEqual({ success: true, - command: 'Bootstraped environemnt successfully.', + command: 'Bootstraped environment successfully.', }); expect(bootstrapEnvironmentSpy).toHaveBeenCalledWith( @@ -135,7 +135,7 @@ describe('runBootstrapExecutor', () => { expect(logger.info).toHaveBeenCalledTimes(1); expect(logger.info).toHaveBeenCalledWith( - 'Execute @org/build-env:build with options: {}' + 'Execute @org/build-env:bootstrap with options: {}' ); expect(logger.error).toHaveBeenCalledTimes(1); diff --git a/tooling/build-env/src/executors/bootstrap/verdaccio-registry.unit-test.ts b/tooling/build-env/src/executors/bootstrap/verdaccio-registry.unit-test.ts index b219d47a..6cbbca32 100644 --- a/tooling/build-env/src/executors/bootstrap/verdaccio-registry.unit-test.ts +++ b/tooling/build-env/src/executors/bootstrap/verdaccio-registry.unit-test.ts @@ -1,10 +1,10 @@ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import { parseRegistryData, startVerdaccioServer } from './verdaccio-registry'; -import { executeProcess } from '../utils/execute-process'; -import type { ChildProcess } from 'node:child_process'; // Adjust import path +import { executeProcess } from '../../internal/execute-process'; +import { ChildProcess } from 'node:child_process'; import { logger } from '@nx/devkit'; -vi.mock('../utils/execute-process'); +vi.mock('../../internal/execute-process'); vi.mock('@nx/devkit', async () => { const actual = await vi.importActual('@nx/devkit'); @@ -89,7 +89,7 @@ describe('startVerdaccioServer', () => { projectName: 'test-project', }); - expect(result).toEqual({ + expect(result).toStrictEqual({ registry: { pid: 12345, storage: expect.any(String), diff --git a/tooling/build-env/src/executors/setup/executor.ts b/tooling/build-env/src/executors/setup/executor.ts index 82e163d3..fe863301 100644 --- a/tooling/build-env/src/executors/setup/executor.ts +++ b/tooling/build-env/src/executors/setup/executor.ts @@ -1,8 +1,4 @@ -import { - type ExecutorContext, - logger, - readJsonFile, -} from '@nx/devkit'; +import { type ExecutorContext, logger, readJsonFile } from '@nx/devkit'; import { join } from 'node:path'; import runBootstrapExecutor from '../bootstrap/executor'; import runKillProcessExecutor from '../kill-process/executor'; diff --git a/tooling/build-env/src/index.ts b/tooling/build-env/src/index.ts index daf76583..63fc709b 100644 --- a/tooling/build-env/src/index.ts +++ b/tooling/build-env/src/index.ts @@ -1,5 +1,2 @@ -export { - getEnvironmentsRoot, - getEnvironmentRoot, -} from './internal/utils/setup'; +export { getEnvironmentsRoot, getEnvironmentRoot } from './internal/setup'; export { createNodes } from './plugin/plugin';