Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Valeriy Svydenko <[email protected]>
  • Loading branch information
svor committed Sep 19, 2023
1 parent 2ec9ccb commit 026ed9a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions tools/devworkspace-generator/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import * as jsYaml from 'js-yaml';
import * as fs from 'fs-extra';
import { DevfileContext } from './api/devfile-context';
import { DevContainerComponentFinder } from './devfile/dev-container-component-finder';
import { UrlFetcher } from './fetch/url-fetcher';

type DevfileLike = V221Devfile & {
metadata: V221DevfileMetadata & {
Expand All @@ -35,8 +34,6 @@ type DevfileLike = V221Devfile & {
export class Generate {
@inject(DevContainerComponentFinder)
private devContainerComponentFinder: DevContainerComponentFinder;
@inject(UrlFetcher)
private urlFetcher: UrlFetcher;

async generate(
devfileContent: string,
Expand Down
9 changes: 0 additions & 9 deletions tools/devworkspace-generator/tests/generate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,19 @@ import { Container } from 'inversify';
import { Generate } from '../src/generate';
import { DevContainerComponentFinder } from '../src/devfile/dev-container-component-finder';
import { DevContainerComponentInserter } from '../src/devfile/dev-container-component-inserter';
import { UrlFetcher } from '../src/fetch/url-fetcher';

describe('Test Generate', () => {
let container: Container;
let generate: Generate;
let devContainerFinder: DevContainerComponentFinder;

const urlFetcherFetchTextMock = jest.fn();
const urlFetcherFetchTextOptionalMock = jest.fn();
const urlFetcher = {
fetchText: urlFetcherFetchTextMock,
fetchTextOptionalContent: urlFetcherFetchTextOptionalMock,
} as any;

beforeEach(() => {
jest.restoreAllMocks();
jest.resetAllMocks();
container = new Container();
container.bind(Generate).toSelf().inSingletonScope();
container.bind(DevContainerComponentFinder).toSelf().inSingletonScope();
container.bind(DevContainerComponentInserter).toSelf().inSingletonScope();
container.bind(UrlFetcher).toConstantValue(urlFetcher);
generate = container.get(Generate);
devContainerFinder = container.get(DevContainerComponentFinder);
});
Expand Down

0 comments on commit 026ed9a

Please sign in to comment.