@@ -311,7 +311,7 @@ export default {
311311 }
312312 }
313313 else {
314- if ( this . $store . state . exportOauth === ' on ' || this . $store . state . exportOauthGithub === ' on ' ){ return ` <template> \n\t ${ str }${ templateTagStr }${ routeStr } </div> \n <Oauth/> \n </template> ` }
314+
315315 return ` <template>\n\t ${ str}${ templateTagStr}${ routeStr} </div>\n </template>`
316316 }
317317 },
@@ -508,6 +508,25 @@ export default {
508508 fs .writeFileSync (path .join (location, " firebaseConfig.js" ), str);
509509 }
510510 },
511+
512+ createjestConfigFile (location ){
513+ if (this .$store .state .importTest === ' on' ){
514+ let str = ` module.exports = {` ;
515+ str += ` \n\t preset: '@vue/cli-plugin-unit-jest'` ;
516+ str += ` \n }`
517+ fs .writeFileSync (path .join (location," jest.config.js" ), str);
518+ }
519+ },
520+ createbabelConfigFile (location ){
521+ if (this .$store .state .importTest === ' on' ){
522+ let str = ` module.exports = {` ;
523+ str += ` \n\t presets: [` ;
524+ str += ` \n\t\t '@vue/cli-plugin-babel/preset'` ;
525+ str += ` \n\t ]` ;
526+ str += ` \n }`
527+ fs .writeFileSync (path .join (location," babel.config.js" ), str);
528+ }
529+ },
511530 createOauthFile (location ){
512531 if (this .$store .state .exportOauth === ' on' || this .$store .state .exportOauthGithub === ' on' ){
513532 let str = ` <template>` ;
@@ -784,6 +803,18 @@ export default {
784803 str += ` \n\t\t "eslint": "^8.5.0",` ;
785804 str += ` \n\t\t "eslint-plugin-vue": "^8.2.0",` ;
786805 str += ` \n\t\t "vite": "^2.8.4"`
806+ if (this .$store .state .importTest === ' on' ){
807+ str+= ` ,\n\t\t "@babel/core": "^7.12.16",`
808+ str+= ` \n\t\t "@babel/eslint-parser": "^7.12.16",`
809+ str+= ` \n\t\t "@vue/cli-plugin-babel": "~5.0.0",`
810+ str+= ` \n\t\t "@vue/cli-plugin-eslint": "~5.0.0",`
811+ str+= ` \n\t\t "@vue/cli-plugin-unit-jest": "~5.0.0",`
812+ str+= ` \n\t\t "@vue/cli-service": "~5.0.0",`
813+ str+= ` \n\t\t "@vue/test-utils": "^2.0.0-0",`
814+ str+= ` \n\t\t "@vue/vue3-jest": "^27.0.0-alpha.1",`
815+ str+= ` \n\t\t "babel-jest": "^27.0.6",`
816+ str+= ` \n\t\t "jest": "^27.0.5"`
817+ }
787818 if (this .exportAsTypescript === " on" ) {
788819 str += ` ,\n\t\t "@rushstack/eslint-patch": "^1.1.0",`
789820 str += ` \n\t\t "@vue/tsconfig": "^0.1.3",` ;
@@ -819,6 +850,8 @@ export default {
819850 this .createStore (data);
820851 this .createFirebaseConfigFile (data);
821852 this .createOauthFile (data);
853+ this .createjestConfigFile (data);
854+ this .createbabelConfigFile (data)
822855 // exports images to the /assets folder
823856 // eslint-disable-next-line no-unused-vars
824857 for (let [routeImage, imageLocation] of Object .entries (this .imagePath )) {
0 commit comments