Skip to content

Commit 586a2a5

Browse files
chore: adjust tests path and package build
1 parent 5d17b08 commit 586a2a5

7 files changed

+839
-16
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
dist/
3+
coverage/

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
node_modules
44
.cache
55
dist
6+
coverage

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
tmp/
33
dist/
4+
coverage/
45
*.d.ts
56
package.json
67
tsconfig.json

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'jsdom',
44
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
5+
testMatch: ['**/tests/*.[jt]s?(x)'],
56
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/']
67
};

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
],
1212
"scripts": {
1313
"dev": "microbundle watch",
14-
"build": "microbundle",
14+
"build": "trash dist/ && microbundle --no-sourcemap",
1515
"test": "jest",
16+
"test:cov": "jest --coverage",
1617
"lint": "eslint src --ext .ts,.tsx",
1718
"prepublishOnly": "make lint && make test && make build"
1819
},
@@ -63,6 +64,7 @@
6364
"react": "^16.13.1",
6465
"react-dom": "^16.13.1",
6566
"react-test-renderer": "^16.13.1",
67+
"trash-cli": "^3.0.0",
6668
"ts-jest": "^26.0.0",
6769
"typescript": "^3.9.2"
6870
},

src/__tests__/useInputFile.tsx tests/useInputFile.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { FC } from 'react';
22
import { act, renderHook } from '@testing-library/react-hooks';
33
import { fireEvent, render } from '@testing-library/react';
4-
import useInputFile, { Options } from '..';
4+
import useInputFile, { Options } from '../src';
55

66
const setup = () => {
77
const ref = { current: document.createElement('input') };

0 commit comments

Comments
 (0)