@@ -53,32 +53,35 @@ const paths = [
5353 // path.join(__dirname, "..", "..", "packages", "middleware-user-agent"),
5454 // path.join(__dirname, "..", "..", "packages", "middleware-websocket"),
5555 // path.join(__dirname, "..", "..", "packages", "s3-presigned-post"),
56- // path.join(__dirname, "..", "..", "private", "aws-middleware-test"),
57- // path.join(__dirname, "..", "..", "private", "aws-util-test"),
58- // path.join(__dirname, "..", "..", "private", "aws-client-api-test"),
59- // path.join(__dirname, "..", "..", "private", "aws-client-retry-test"),
60- // path.join(__dirname, "..", "..", "private", "aws-echo-service"),
61- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-ec2"),
62- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-json"),
63- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-json-10"),
64- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-json-machinelearning"),
65- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-query"),
66- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-restjson"),
67- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-restjson-apigateway"),
68- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-restjson-glacier"),
69- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-restxml"),
70- // path.join(__dirname, "..", "..", "private", "aws-protocoltests-smithy-rpcv2-cbor"),
71- // path.join(__dirname, "..", "..", "private", "aws-restjson-server"),
72- // path.join(__dirname, "..", "..", "private", "aws-restjson-validation-server"),
56+ path . join ( __dirname , ".." , ".." , "private" , "aws-middleware-test" ) ,
57+ path . join ( __dirname , ".." , ".." , "private" , "aws-util-test" ) ,
58+ path . join ( __dirname , ".." , ".." , "private" , "aws-client-api-test" ) ,
59+ path . join ( __dirname , ".." , ".." , "private" , "aws-client-retry-test" ) ,
60+ path . join ( __dirname , ".." , ".." , "private" , "aws-echo-service" ) ,
61+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-ec2" ) ,
62+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-json" ) ,
63+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-json-10" ) ,
64+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-json-machinelearning" ) ,
65+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-query" ) ,
66+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-restjson" ) ,
67+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-restjson-apigateway" ) ,
68+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-restjson-glacier" ) ,
69+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-restxml" ) ,
70+ path . join ( __dirname , ".." , ".." , "private" , "aws-protocoltests-smithy-rpcv2-cbor" ) ,
71+ path . join ( __dirname , ".." , ".." , "private" , "aws-restjson-server" ) ,
72+ path . join ( __dirname , ".." , ".." , "private" , "aws-restjson-validation-server" ) ,
7373] ;
7474
7575( async ( ) => {
7676 for ( const folder of paths ) {
7777 const pkgJson = require ( path . join ( folder , "package.json" ) ) ;
7878
7979 if ( pkgJson . scripts . test ) {
80- fs . rmSync ( path . join ( folder , "jest.config.js" ) ) ;
81- if ( pkgJson . scripts . test . includes ( "jest" ) ) {
80+ if ( fs . existsSync ( path . join ( folder , "jest.config.js" ) ) ) {
81+ fs . rmSync ( path . join ( folder , "jest.config.js" ) ) ;
82+ }
83+
84+ if ( pkgJson . scripts . test . includes ( "jest" ) || pkgJson . scripts . test . includes ( "vitest" ) ) {
8285 console . log ( "setting unit test to vitest" ) ;
8386
8487 pkgJson . scripts . test = "vitest run" ;
@@ -97,19 +100,23 @@ const paths = [
97100 `
98101 ) ;
99102 } else if ( pkgJson . scripts . test . includes ( "vitest" ) ) {
100- pkgJson . scripts [ "test:watch" ] ??= "vitest watch --passWithNot " ;
103+ pkgJson . scripts [ "test:watch" ] ??= "vitest watch --passWithNoTests " ;
101104 }
102105 }
103106
104107 for ( const testType of [ "integ" , "e2e" ] ) {
105108 const script = testType === "integ" ? "integration" : testType ;
109+ if ( fs . existsSync ( path . join ( folder , `jest.config.${ testType } .js` ) ) ) {
110+ fs . rmSync ( path . join ( folder , `jest.config.${ testType } .js` ) ) ;
111+ }
106112 if ( pkgJson . scripts [ `test:${ script } ` ] ) {
107113 pkgJson . scripts [ `test:${ script } :watch` ] = `vitest watch -c vitest.config.${ testType } .ts` ;
108- if ( pkgJson . scripts [ `test:${ script } ` ] . includes ( "jest" ) ) {
114+ if (
115+ pkgJson . scripts [ `test:${ script } ` ] . includes ( "jest" ) ||
116+ pkgJson . scripts [ `test:${ script } ` ] . includes ( "vitest" )
117+ ) {
109118 console . log ( `setting ${ testType } test to vitest` ) ;
110-
111119 pkgJson . scripts [ `test:${ script } ` ] = `vitest run -c vitest.config.${ testType } .ts` ;
112- fs . rmSync ( path . join ( folder , `jest.config.${ testType } .js` ) ) ;
113120 fs . writeFileSync (
114121 path . join ( folder , `vitest.config.${ testType } .ts` ) ,
115122 `import { defineConfig } from "vitest/config";
0 commit comments