This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ describe('browserify preprocessor - e2e', function () {
34
34
} )
35
35
36
36
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
38
return bundle ( 'math_spec.ts' , {
39
39
typescript : require . resolve ( 'typescript' ) ,
40
40
} ) . then ( ( output ) => {
@@ -43,9 +43,22 @@ describe('typescript', function () {
43
43
} )
44
44
} )
45
45
46
- it ( 'cannot handle typescript when the path is not given' , function ( ) {
46
+ it ( 'handles .tsx file when the path is given' , function ( ) {
47
+ return bundle ( 'math_spec.ts' , {
48
+ typescript : require . resolve ( 'typescript' ) ,
49
+ } ) . then ( ( output ) => {
50
+ // check that bundled tests work
51
+ eval ( output )
52
+ } )
53
+ } )
54
+
55
+ it ( 'cannot handle .ts file when the path is not given' , function ( ) {
47
56
expect ( ( ) => bundle ( 'math_spec.ts' ) ) . to . throw
48
57
} )
58
+
59
+ it ( 'cannot handle .tsx file when the path is not given' , function ( ) {
60
+ expect ( ( ) => bundle ( 'math_spec.tsx' ) ) . to . throw
61
+ } )
49
62
} )
50
63
51
64
describe ( 'imports and exports' , ( ) => {
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments