You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					22 lines
				
				667 B
			
		
		
			
		
	
	
					22 lines
				
				667 B
			| 
								 
											4 years ago
										 
									 | 
							
								module.exports = api => {
							 | 
						||
| 
								 | 
							
								  api.registerCommand('test:unit', {
							 | 
						||
| 
								 | 
							
								    description: 'run unit tests with jest',
							 | 
						||
| 
								 | 
							
								    usage: 'vue-cli-service test:unit [options] <regexForTestFiles>',
							 | 
						||
| 
								 | 
							
								    options: {
							 | 
						||
| 
								 | 
							
								      '--watch': 'run tests in watch mode'
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    details:
							 | 
						||
| 
								 | 
							
								      `All jest command line options are supported.\n` +
							 | 
						||
| 
								 | 
							
								      `See https://facebook.github.io/jest/docs/en/cli.html for more details.`
							 | 
						||
| 
								 | 
							
								  }, (args, rawArgv) => {
							 | 
						||
| 
								 | 
							
								    // for @vue/babel-preset-app <= v4.0.0-rc.7
							 | 
						||
| 
								 | 
							
								    process.env.VUE_CLI_BABEL_TARGET_NODE = true
							 | 
						||
| 
								 | 
							
								    process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true
							 | 
						||
| 
								 | 
							
								    require('jest').run(rawArgv)
							 | 
						||
| 
								 | 
							
								  })
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports.defaultModes = {
							 | 
						||
| 
								 | 
							
								  'test:unit': 'test'
							 | 
						||
| 
								 | 
							
								}
							 |