Skip to content

Commit 24aa2c2

Browse files
committed
test: Rewrite case from #8 for filenames
1 parent 76f0425 commit 24aa2c2

File tree

6 files changed

+2581
-56
lines changed

6 files changed

+2581
-56
lines changed

test/injector/should-include-component-based/injectOptions.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/injector/should-include-component-based/output.json

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
includeUnusedProps: true,
5+
shouldInclude: ({ prop }) => {
6+
let isLocallyTyped = false;
7+
prop.filenames.forEach((filename) => {
8+
if (!path.relative(__dirname, filename).startsWith('..')) {
9+
isLocallyTyped = true;
10+
}
11+
});
12+
return isLocallyTyped;
13+
},
14+
};

test/injector/should-include-component-based/input.tsx renamed to test/injector/should-include-filename-based/input.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ import * as React from 'react';
33
// it's technically not correct since this descripts props the component
44
// sees not just the one available to the user. We're abusing this to provide
55
// some concrete documentation for `key` regarding this component
6-
export interface SnackBarProps {
6+
export interface SnackBarProps extends React.HTMLAttributes<any> {
77
/**
88
* some hints about state reset that relates to prop of this component
99
*/
1010
key?: any;
11-
/**
12-
* some prop that is inherited which we don't care about here
13-
*/
14-
onChange?: () => any;
1511
}
1612

1713
export function Snackbar(props: SnackBarProps) {
File renamed without changes.

0 commit comments

Comments
 (0)