Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 2b04aa6

Browse files
committed
perf: Tests are written in typescript
1 parent 62646cd commit 2b04aa6

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/index.js
22
/node_modules
33
*.js.map
4+
/tests/*-test.js

Diff for: package.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"react2dts": "cli.js"
88
},
99
"scripts": {
10+
"clean": "rm -f index.js index.js.map tests/*.js tests/*.js.map",
11+
"prebuild": "npm run clean",
1012
"build": "tsc",
1113
"pretest": "npm run build",
1214
"test": "mocha -r babel-register 'tests/**/*-test.js'",

Diff for: tests/component-test.js renamed to tests/component-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import * as path from 'path';
44

55
import * as react2dts from '../index';
66

7-
describe('Parsing', function() {
8-
it('should create definition from simple component', function() {
7+
describe('Parsing', () => {
8+
it('should create definition from simple component', () => {
99
assert.equal(
1010
react2dts.generateFromFile('simple-component', path.join(__dirname, 'simple-component.jsx')),
1111
fs.readFileSync(path.join(__dirname, 'simple-component.d.ts')).toString()

Diff for: tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
"files": [
99
"typings/tsd.d.ts",
10-
"index.ts"
10+
"index.ts",
11+
"tests/component-test.ts"
1112
]
1213
}

0 commit comments

Comments
 (0)