UNPKG

yhtml5-test

Version:

A test framework for front-end projects

41 lines (33 loc) 891 B
/** * The config of yhtml5 * TODO * */ const fs = require('fs'); const path = require('path'); const { isBeforePublish, appPath } = require('./utils/paths') const hasConfigJs = fs.existsSync(path.resolve(appPath, './.config.js')) // config after publish: we're in ./node_modules/yhtml5-test/ const Config = isBeforePublish ? require('./demo/.config.js') : hasConfigJs ? require('../../.config.js') : {} isBeforePublish && console.log('\n.config.js', { isBeforePublish, "demo/.config.js": require('./demo/.config.js') }) const { test = {} } = Config const { testMatch = [], transformIgnorePatterns = [], collectCoverageFrom = [], moduleNameMapper = {} } = test const _testMatch = testMatch.map((value, index) => path.resolve(appPath, value)) module.exports = { testMatch: _testMatch, transformIgnorePatterns, collectCoverageFrom, moduleNameMapper }