-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
CSpellIONode.test.ts
45 lines (40 loc) · 1.55 KB
/
CSpellIONode.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { CSpellIONode } from './CSpellIONode';
const sc = expect.stringContaining;
describe('CSpellIONode', () => {
test('constructor', () => {
const cspellIo = new CSpellIONode();
expect(cspellIo).toBeDefined();
});
test.each`
filename | expected
${__filename} | ${sc('This bit of text')}
`('readFile', async ({ filename, expected }) => {
const cspellIo = new CSpellIONode();
await expect(cspellIo.readFile(filename)).resolves.toEqual(expected);
});
test.each`
filename | expected
${__filename} | ${'Unhandled Request: fs:readFileSync' /* sc('This bit of text') */}
`('readFileSync', ({ filename, expected }) => {
const cspellIo = new CSpellIONode();
expect(() => cspellIo.readFileSync(filename)).toThrow(expected);
});
// readFile(_uriOrFilename: string): Promise<string> {
// throw new ErrorNotImplemented('readFile');
// }
// readFileSync(_uriOrFilename: string): string {
// throw new ErrorNotImplemented('readFileSync');
// }
// writeFile(_uriOrFilename: string, _content: string): Promise<void> {
// throw new ErrorNotImplemented('writeFile');
// }
// getStat(_uriOrFilename: string): Promise<Stats> {
// throw new ErrorNotImplemented('getStat');
// }
// getStatSync(_uriOrFilename: string): Stats {
// throw new ErrorNotImplemented('getStatSync');
// }
// compareStats(left: Stats, right: Stats): number {
// return compareStats(left, right);
// }
});