Skip to content

Commit 94672b2

Browse files
committed
external fixture
1 parent dc6bade commit 94672b2

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

packages/ts-autocomplete/src/index.spec.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1+
import path from 'path';
2+
import { promises as fs } from 'fs';
13
import Autocompleter from './index';
24
import { expect } from 'chai';
35

4-
const CODE_TS = `
5-
6-
export type MyObject = {
7-
stringProp: string,
8-
functionProp: (p1: number) => void
9-
};
10-
11-
export type MyFunctionParams = { param1: string, param2: string };
12-
13-
declare global {
14-
declare var myGlobalObject: MyObject;
15-
export function myGlobalFunction(params: MyFunctionParams): void {};
16-
}
17-
`;
18-
196
function filterStartingWith({
207
name,
218
trigger,
@@ -30,6 +17,15 @@ function filterStartingWith({
3017
}
3118

3219
describe('Autocompleter', function () {
20+
let CODE_TS: string;
21+
22+
before(async function () {
23+
CODE_TS = await fs.readFile(
24+
path.resolve(__dirname, '..', 'test', 'fixtures', 'code.ts'),
25+
'utf8'
26+
);
27+
});
28+
3329
describe('without filter', function () {
3430
let autoCompleter: Autocompleter;
3531

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable @typescript-eslint/no-empty-function */
2+
export type MyObject = {
3+
stringProp: string;
4+
functionProp: (p1: number) => void;
5+
};
6+
7+
export type MyFunctionParams = { param1: string; param2: string };
8+
9+
declare global {
10+
export const myGlobalObject: MyObject;
11+
export function myGlobalFunction(params: MyFunctionParams): void;
12+
}

0 commit comments

Comments
 (0)