Skip to content

Commit e56eee7

Browse files
authored
feat: Add support for React (#65)
Adds support for testing and building React files (`.tsx` extension). The main work was in: - Adding support for `.tsx` (and `.jsx`) extension for building/testing - Adding `@babel/preset-react` - Adding enzyme support for spec tests - Upgrading to `eslint-config-react` for linting - Updating the `tsconfig.json` for typing - Streaming output of `integrate` command - Adding integration test to verify React support - Adding docs to reflect support for React
1 parent af1ea2e commit e56eee7

34 files changed

+1142
-136
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,3 @@ typings/
6262

6363
# built directory
6464
lib/
65-
66-
# editor stuffs
67-
.vscode/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v10.16.2

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"jest.enableInlineErrorMessages": false,
3+
"jest.enableSnapshotPreviews": false,
4+
"jest.enableSnapshotUpdateMessages": false,
5+
"jest.autoEnable": false,
6+
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
7+
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false
8+
}

bin/benmvp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
const {code, message, error} = await run(args);
88

99
if (code) {
10-
// console.error(error);
1110
console.error(message);
11+
// console.error(error);
1212
}
1313

1414
process.exit(code)

docs/api/integrate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ The optional `TestOptions` object supports the following properties:
8989
An `Array` of the types or modes of tests to run. Available modes:
9090

9191
- `'spec'` - Runs Jest-based tests (files ending in `.spec.ts` or in `__tests__` folder)
92-
- `'type'` - Runs Typescript type-checking (files ending in `.ts`)
93-
- `'lint'` - Runs ESLint (files ending in `.ts`)
92+
- `'type'` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
93+
- `'lint'` - Runs ESLint (files ending in `.ts` or `.tsx`)
9494

9595
Optional. Defaults to all modes when unspecified.
9696

docs/api/start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ The optional `Options` object supports the following properties:
7777

7878
An `Array` of the types or modes of tests to run. Available modes:
7979

80-
- `'type'` - Runs Typescript type-checking (files ending in `.ts`)
81-
- `'lint'` - Runs ESLint (files ending in `.ts`)
80+
- `'type'` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
81+
- `'lint'` - Runs ESLint (files ending in`.ts` or `.tsx`)
8282
- `'spec'` - Runs Jest-based unit tests (files ending in `.spec.ts`)
8383

8484
Optional. Defaults to all modes when unspecified.

docs/api/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ The optional `TestOptions` object supports the following properties:
8181

8282
An `Array` of the types or modes of tests to run. Available modes:
8383

84-
- `'type'` - Runs Typescript type-checking (files ending in `.ts`)
85-
- `'lint'` - Runs ESLint (files ending in `.ts`)
84+
- `'type'` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
85+
- `'lint'` - Runs ESLint (files ending in `.ts` or `.tsx`)
8686
- `'spec'` - Runs Jest-based unit tests (files ending in `.spec.ts`)
8787

8888
Optional. Defaults to all modes when unspecified.

docs/cli/integrate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ benmvp integrate --modes lint --pattern api/
5454
A space-separated list of the types or modes of tests to run. Aliased as `-m`. Available modes:
5555

5656
- `spec` - Runs Jest-based tests (files ending in `.spec.ts` or in `__tests__` folder)
57-
- `lint` - Runs ESLint (files ending in `.ts`)
58-
- `type` - Runs Typescript type-checking (files ending in `.ts`)
57+
- `lint` - Runs ESLint (files ending in `.ts` or `.tsx`)
58+
- `type` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
5959

6060
Optional. Defaults to all modes.
6161

docs/cli/start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ benmvp start --modes lint --pattern api/
4444

4545
A space-separated list of the types or modes of tests to run. Aliased as `-m`. Available modes:
4646

47-
- `lint` - Runs ESLint (files ending in `.ts`)
48-
- `type` - Runs Typescript type-checking (files ending in `.ts`)
47+
- `lint` - Runs ESLint (files ending in `.ts` or `.tsx`)
48+
- `type` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
4949
- `spec` - Runs Jest-based unit tests (files ending in `.spec.ts`)
5050

5151
Optional. Defaults to all modes.

docs/cli/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ benmvp test --modes lint --pattern api/ --watch
4444

4545
A space-separated list of the types or modes of tests to run. Aliased as `-m`. Available modes:
4646

47-
- `lint` - Runs ESLint (files ending in `.ts`)
48-
- `type` - Runs Typescript type-checking (files ending in `.ts`)
47+
- `lint` - Runs ESLint (files ending in `.ts` or `.tsx`)
48+
- `type` - Runs Typescript type-checking (files ending in `.ts` or `.tsx`)
4949
- `spec` - Runs Jest-based unit tests (files ending in `.spec.ts` or in `__tests__` folder)
5050

5151
Optional. Defaults to all modes.

0 commit comments

Comments
 (0)