File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 11const fs = require ( 'fs' ) ;
22const path = require ( 'path' ) ;
3- const { register } = require ( 'esbuild-register/dist/node ' ) ;
3+ const swcRegister = require ( '@swc/register ' ) ;
44
55const [ testSuiteDir ] = process . argv . slice ( 2 ) ;
66
@@ -20,8 +20,16 @@ process.env.PAYLOAD_CONFIG_PATH = configPath;
2020
2121process . env . PAYLOAD_DROP_DATABASE = 'true' ;
2222
23- register ( {
24- platform : 'node' ,
23+ swcRegister ( {
24+ jsc : {
25+ parser : {
26+ syntax : 'typescript' ,
27+ tsx : true ,
28+ } ,
29+ } ,
30+ module : {
31+ type : 'commonjs' ,
32+ } ,
2533} ) ;
2634
2735require ( './devServer' ) ;
Original file line number Diff line number Diff line change @@ -139,15 +139,10 @@ export class RESTClient {
139139 }
140140
141141 const slug = args . slug || this . defaultSlug ;
142- try {
143- const response = await fetch ( `${ this . serverURL } /api/${ slug } ` , options ) ;
144- const { status } = response ;
145- const { doc } = await response . json ( ) ;
146- return { status, doc } ;
147- } catch ( err ) {
148- console . error ( err ) ;
149- return { status : 500 } ;
150- }
142+ const response = await fetch ( `${ this . serverURL } /api/${ slug } ` , options ) ;
143+ const { status } = response ;
144+ const { doc } = await response . json ( ) ;
145+ return { status, doc } ;
151146 }
152147
153148 async find < T = any > ( args ?: FindArgs ) : Promise < QueryResponse < T > > {
You can’t perform that action at this time.
0 commit comments