import { Config } from '@jest/types' ; import path from 'path' ; const jestConfig = ( collectCoverageFrom ) : Config . InitialOptions => ( { transform : { '^.+\\.[jt]sx?$' : require . resolve ( 'babel-jest' ) , '^.+\\.vue$' : require . resolve ( 'vue-jest' ) , '^.+\\.md$' : path . resolve ( __dirname , '../plugins/md-vue-jest/index.js' ) , } , collectCoverageFrom : collectCoverageFrom . concat ( [ 'src/**/*.{vue,tsx,ts}' , '!components/icon/**/*' , '!**/style/*' , ] ) , coverageDirectory : '.coverage' , } ) ; export default jestConfig ;