Skip to content

Commit

Permalink
fix: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adelkahomolova committed Jan 16, 2020
1 parent 3facd70 commit b0402b4
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/inspectors/FileInspector.spec.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,29 @@
import { FileInspector } from '.';
import { createTestContainer, TestContainerContext } from '../inversify.config';
import { FileSystemService } from '../services';
import { DirectoryJSON } from 'memfs/lib/volume';
import path from 'path';

describe('GitignoreIsPresentPractice', () => {
let fileInspector: FileInspector;
let containerCtx: TestContainerContext;
let virtualFileSystemService: FileSystemService;

beforeAll(() => {
containerCtx = createTestContainer();
containerCtx.container.bind('FileInspector').to(FileInspector);
fileInspector = containerCtx.container.get('FileInspector');
});

// beforeEach(() => {
// virtualFileSystemService = new FileSystemService({ isVirtual: true });
// fileInspector = new FileInspector(virtualFileSystemService, '/');
// });

afterEach(async () => {
containerCtx.virtualFileSystemService.clearFileSystem();
containerCtx.practiceContext.fileInspector!.purgeCache();
});

it('Throws an error if the file does not exist', async () => {
const path = './';
// const structure: DirectoryJSON = {
// '/index.cpp': '...',
// };

// virtualFileSystemService.setFileSystem(structure);
try {
await fileInspector.scanFor('not.exist', path);
fail();
} catch (error) {
expect(error.message).toEqual(`ENOENT: no such file or directory, readdir '${path}'`);
}
// expect(async () => {
// await fileInspector.scanFor('not.exist', path);
// }).toThrow();
});

// it('Returns practicing if there is a .gitignore', async () => {
// const structure: DirectoryJSON = {
// '/index.cpp': '...',
// };

// virtualFileSystemService.setFileSystem(structure);
// const isFile = await fileInspector.isFile('/index.cpp');
// expect(isFile).toEqual(true);
// });
});

0 comments on commit b0402b4

Please sign in to comment.