Skip to content

Commit

Permalink
Remove unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda committed Dec 26, 2023
1 parent 62127e0 commit 65e25e4
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions __tests__/EncodeCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,44 +92,6 @@ describe('PlantUMLServer', () => {
});
});

describe('writeCache', () => {
it('Conversion results are cached in the file system using the hash of the uml document as a key', async () => {
const plantUMLServer = new PlantUMLServer({
server: 'http://test.invalid',
format: 'svg',
cacheDir: '/path/to/cache',
cssClass: 'bar',
});
const uml = 'Bob -> Alice : Hello!';
const hash = createHash('sha1').update(uml).digest('hex');

await plantUMLServer.generate(uml);
await plantUMLServer.writeCache();
expect(writeFile).toBeCalledWith(
'/path/to/cache/honkit-plugin-plantuml-server-' + hash + '.svg',
svg,
);
expect(writeFile).toBeCalledTimes(1);
expect(makeCacheDirectory).toBeCalledTimes(1);
});

it('If `cacheDir` is not set, conversion results will not be cached.', async () => {
const plantUMLServer = new PlantUMLServer({
server: 'http://test.invalid',
format: 'svg',
cacheDir: null,
cssClass: 'bar',
});
const uml = 'Bob -> Alice : Hello!';
const hash = createHash('sha1').update(uml).digest('hex');

await plantUMLServer.generate(uml);
await plantUMLServer.writeCache();
expect(writeFile).not.toBeCalled();
expect(makeCacheDirectory).not.toBeCalled();
});
});

describe('readFile', () => {
it('Read file from arbitrary path', async () => {
readFile!.mockReturnValue(Promise.resolve(Buffer.from('foo')));
Expand Down

0 comments on commit 65e25e4

Please sign in to comment.