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

Commit 997a5d3

Browse files
committed
Test .tsx file.
1 parent d02daf5 commit 997a5d3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/e2e/e2e_spec.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ describe('browserify preprocessor - e2e', function () {
3434
})
3535

3636
describe('typescript', function () {
37-
it('handles typescript when the path is given', function () {
37+
it('handles .ts file when the path is given', function () {
38+
return bundle('math_spec.ts', {
39+
typescript: require.resolve('typescript'),
40+
}).then((output) => {
41+
// check that bundled tests work
42+
eval(output)
43+
})
44+
})
45+
46+
it('handles .tsx file when the path is given', function () {
3847
return bundle('math_spec.ts', {
3948
typescript: require.resolve('typescript'),
4049
}).then((output) => {

test/fixtures/math_spec.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import math from './math'
2+
3+
interface Props {
4+
greeting: string
5+
}
6+
7+
export const Foo = ({ greeting }: Props) => {
8+
return <div>{greeting}{math.add(1, 2)}</div>
9+
}

0 commit comments

Comments
 (0)