Skip to content

Commit d00c7f2

Browse files
committed
test: add missing test config
1 parent e44972d commit d00c7f2

File tree

5 files changed

+2789
-92
lines changed

5 files changed

+2789
-92
lines changed

Diff for: .vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Debug test",
11+
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
12+
"args": ["test/index.test.ts"]
13+
}
14+
]
15+
}

Diff for: jest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
};

Diff for: test/index.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as ttp from '../src';
2+
import path from 'path';
3+
4+
it('runs', () => {
5+
const tsconfig = ttp.loadConfig(path.resolve(__dirname, '../tsconfig.json'));
6+
7+
const parsed = ttp.parseFile(path.resolve(__dirname, 'testFile.d.ts'), tsconfig);
8+
9+
expect(parsed).toMatchSnapshot();
10+
});

Diff for: test/testFile.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as React from 'react';
2+
3+
type FooProps = {
4+
bar: string;
5+
};
6+
7+
export default function Foo(props: FooProps): JSX.Element;

0 commit comments

Comments
 (0)