Skip to content

Commit

Permalink
Update specs
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 6, 2022
1 parent 5b8d45b commit b40c460
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/fixtures/basic/dep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as ns from './ns';
const x = ns.x;
const y = ns.y;

export const unused = 1;

export const dep = y(x);

export type Dep = any;
Expand Down
18 changes: 12 additions & 6 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@ test('run', async () => {
isOnlyFiles: false,
isOnlyExports: false,
isOnlyTypes: false,
isOnlyNsMembers: false,
isOnlyDuplicates: false,
isFindUnusedFiles: true,
isFindUnusedExports: true,
isFindUnusedTypes: true,
isFindDuplicateExports: true,
isFollowSymbols: false,
isShowProgress: false
isFindNsImports: true,
isShowProgress: false,
jsDocOptions: {
isReadPublicTag: false,
},
});

assert(issues.file.size === 1);

assert(Array.from(issues.file)[0].endsWith('dangling.ts'));

assert(Object.values(issues.export).length === 1);
assert(issues.export['ns.ts']['z'].symbol === 'z');
assert(issues.export['dep.ts']['unused'].symbol === 'unused');

assert(Object.values(issues.type).length === 2);
assert(Object.values(issues.type).length === 1);
assert(issues.type['dep.ts']['Dep'].symbolType === 'type');
assert(issues.type['ns.ts']['NS'].symbolType === 'interface');

assert(Object.values(issues.member).length === 1);
assert(issues.member['ns.ts']['NS'].symbol === 'NS');
assert(issues.member['ns.ts']['z'].symbol === 'z');

assert(Object.values(issues.duplicate).length === 1);
assert(issues.duplicate['dep.ts']['dep,default'].symbols?.[0] === 'dep');
Expand Down

0 comments on commit b40c460

Please sign in to comment.