@@ -4,21 +4,29 @@ import {
4
4
} from './utils' ;
5
5
6
6
describe ( 'salsa test' , function ( ) {
7
- it ( 'should compile js file' , async function ( ) {
7
+ it ( 'should compile ts file with js invoke ' , async function ( ) {
8
8
let config = {
9
9
entry : fixturePath ( [ 'salsa' , 'index.ts' ] )
10
10
} ;
11
11
12
12
let tsconfig = fixturePath ( [ 'salsa' , 'tsconfig.json' ] ) ;
13
- let loaderQuery = { tsconfig } ;
14
- let exclude = [ / e x c l u d e / ] ;
13
+ let loaderQuery = { tsconfig, tsconfigContent : null } ;
15
14
16
- let stats = await cleanAndCompile ( createConfig ( config , { loaderQuery, exclude } ) ) ;
15
+ let stats = await cleanAndCompile ( createConfig ( config , { loaderQuery } ) ) ;
16
+ console . log ( stats . compilation . errors )
17
+ expect ( stats . compilation . errors . length ) . eq ( 1 ) ;
18
+ } ) ;
17
19
18
- console . log ( stats . compilation . errors ) ;
20
+ xit ( 'should compile js file as entry point' , async function ( ) {
21
+ let config = {
22
+ entry : fixturePath ( [ 'salsa' , 'index.js' ] )
23
+ } ;
24
+
25
+ let tsconfig = fixturePath ( [ 'salsa' , 'tsconfig.json' ] ) ;
26
+ let loaderQuery = { tsconfig, tsconfigContent : null } ;
19
27
20
- expect ( stats . compilation . errors . length ) . eq ( 2 ) ;
21
- expect ( stats . compilation . errors [ 0 ] . toString ( ) ) . include ( 'Cannot find module' ) ;
22
- expect ( stats . compilation . errors [ 1 ] . toString ( ) ) . include ( `Argument of type 'string'` ) ;
28
+ let stats = await cleanAndCompile ( createConfig ( config , { loaderQuery } ) ) ;
29
+ console . log ( stats . compilation . errors )
30
+ expect ( stats . compilation . errors . length ) . eq ( 1 ) ;
23
31
} ) ;
24
32
} ) ;
0 commit comments