Skip to content

Commit

Permalink
Reverts some awkwardness around the re-addition of tsd. Moves the tes…
Browse files Browse the repository at this point in the history
…ts into type_tests to avoid needing to place in dist.
  • Loading branch information
owenallenaz committed Oct 2, 2020
1 parent de82443 commit cc70863
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
yarn.lock
dist
!dist/index.test-d.ts
29 changes: 0 additions & 29 deletions dist/index.test-d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"test": "xo && npm run build && tsd && ava",
"build": "del-cli 'dist/*' '!dist/index.test-d.ts' && tsc",
"build": "del-cli dist && tsc",
"prepack": "npm run build"
},
"main": "dist",
Expand Down Expand Up @@ -71,6 +71,6 @@
}
},
"tsd": {
"directory": "tests"
"directory": "type_tests"
}
}
2 changes: 0 additions & 2 deletions tests/index.test-d.ts → type_tests/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {expectType} from 'tsd';
import mem = require('../dist');

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const fn = (_string: string) => true;

expectType<typeof fn>(mem(fn));
Expand All @@ -21,7 +20,6 @@ expectType<typeof fn>(
);

// Testing that the full cache object works with type inference
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function objectFnReturnsNumber(_args: {key: string}) {
return 10;
}
Expand Down

1 comment on commit cc70863

@fregante
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I thought tsdjs/tsd#74 was needed to avoid this

Please sign in to comment.