@@ -110,17 +110,16 @@ export default {
110110
111111 const imports = ` import { mount } from '@vue/test-utils'
112112import ${ componentName} from '../../src/components/${ componentName} .vue'
113-
114113`
115114
116115 const results = [imports];
117116
118117 for (const el of htmlList) {
119118 const test = `
120119test('renders ${ componentName} ', () => {
121- const wrapper = mount(${ componentName} )
120+ const wrapper = mount(${ componentName} )
122121
123- // customize your tests here; for more info please visit: https://github.com/vuejs/test-utils/
122+ // customize your tests here; for more info please visit: https://github.com/vuejs/test-utils/
124123})`
125124 results .push (test);
126125 }
@@ -235,11 +234,11 @@ const wrapper = mount(${componentName})
235234 // eslint-disable-next-line no-unused-vars
236235 for (let i = 0 ; i < htmlArr .length ; i++ ) {
237236 const el = htmlArr[i];
238- // if (!el.text) {
239- // outputStr += ` <${el} data-test="${componentName}-${el}-${i}" />\n`;
240- // } else {
241- // outputStr += ` `;
242- // outputStr += htmlElementMap[el.text][0] + ` data-test="${componentName}-${el.text}-${el.id}"`
237+ if (! el .text ) {
238+ outputStr += ` <${ el} />\n ` ;
239+ } else {
240+ outputStr += ` ` ;
241+ outputStr += htmlElementMap[el .text ][0 ];
243242 // if conditional to check class
244243 if (el .class !== " " ) {
245244 outputStr += " " + " class = " + ` "${ el .class } "` ;
@@ -259,6 +258,7 @@ const wrapper = mount(${componentName})
259258 }
260259 }
261260 return outputStr;
261+ }
262262 },
263263 writeComments (componentName ) {
264264 if (this .componentMap [componentName]? .noteList ? .length > 0 ) {
@@ -518,6 +518,23 @@ const wrapper = mount(${componentName})
518518</style >`
519519 } else return ` \n\n <style scoped>\n ${ styleString} </style >` ;
520520 },
521+ // create Babel config for testing
522+ createBabelConfigFile (location ) {
523+ let str = `
524+ module.exports = {
525+ presets: [
526+ ['@babel/preset-env',
527+ {
528+ targets: {
529+ node: 'current'
530+ }
531+ }
532+ ]
533+ ]
534+ }`
535+ fs .writeFileSync (path .join (location, " babel.config.js" ), str);
536+ },
537+ // create Firebase config for OAuth
521538 createFirebaseConfigFile (location ) {
522539 if (this .$store .state .exportOauth === ' on' ){
523540 let str = ` import { initializeApp } from 'firebase/app';` ;
0 commit comments