From 610d1aabe9aa59078b2567efcd1f2edf881fb9b4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 17 Jun 2017 19:11:38 +0800 Subject: [PATCH] build: move test config files into /test --- build/.eslintrc | 5 ----- package.json | 8 ++++---- {build => test/e2e}/nightwatch.config.js | 0 test/e2e/runner.js | 2 +- {build => test/unit}/karma.base.config.js | 6 +++--- {build => test/unit}/karma.cover.config.js | 4 ++-- {build => test/unit}/karma.dev.config.js | 0 {build => test/unit}/karma.sauce.config.js | 0 {build => test/unit}/karma.unit.config.js | 0 9 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 build/.eslintrc rename {build => test/e2e}/nightwatch.config.js (100%) rename {build => test/unit}/karma.base.config.js (87%) rename {build => test/unit}/karma.cover.config.js (84%) rename {build => test/unit}/karma.dev.config.js (100%) rename {build => test/unit}/karma.sauce.config.js (100%) rename {build => test/unit}/karma.unit.config.js (100%) diff --git a/build/.eslintrc b/build/.eslintrc deleted file mode 100644 index 33fe5937..00000000 --- a/build/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "camelcase": 0 - } -} diff --git a/package.json b/package.json index 57b83e05..926978e5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dev": "rollup -w -c build/config.js --environment TARGET:web-full-dev", "dev:cjs": "rollup -w -c build/config.js --environment TARGET:web-runtime-cjs", "dev:esm": "rollup -w -c build/config.js --environment TARGET:web-runtime-esm", - "dev:test": "karma start build/karma.dev.config.js", + "dev:test": "karma start test/unit/karma.dev.config.js", "dev:ssr": "rollup -w -c build/config.js --environment TARGET:web-server-renderer", "dev:compiler": "rollup -w -c build/config.js --environment TARGET:web-compiler ", "dev:weex": "rollup -w -c build/config.js --environment TARGET:weex-framework ", @@ -24,8 +24,8 @@ "build:ssr": "npm run build -- vue.runtime.common.js,vue-server-renderer", "build:weex": "npm run build -- weex-vue-framework,weex-template-compiler", "test": "npm run lint && flow check && npm run test:types && npm run test:cover && npm run test:e2e -- --env phantomjs && npm run test:ssr && npm run test:weex", - "test:unit": "karma start build/karma.unit.config.js", - "test:cover": "karma start build/karma.cover.config.js", + "test:unit": "karma start test/unit/karma.unit.config.js", + "test:cover": "karma start test/unit/karma.cover.config.js", "test:e2e": "npm run build -- vue.min.js && node test/e2e/runner.js", "test:weex": "npm run build:weex && jasmine JASMINE_CONFIG_PATH=test/weex/jasmine.json", "test:ssr": "npm run build:ssr && jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json", @@ -33,7 +33,7 @@ "test:types": "tsc -p ./types/test/tsconfig.json", "lint": "eslint src build test", "flow": "flow check", - "sauce": "karma start build/karma.sauce.config.js", + "sauce": "karma start test/unit/karma.sauce.config.js", "bench:ssr": "npm run build:ssr && node benchmarks/ssr/renderToString.js && node benchmarks/ssr/renderToStream.js", "release": "bash build/release.sh", "release:weex": "bash build/release-weex.sh", diff --git a/build/nightwatch.config.js b/test/e2e/nightwatch.config.js similarity index 100% rename from build/nightwatch.config.js rename to test/e2e/nightwatch.config.js diff --git a/test/e2e/runner.js b/test/e2e/runner.js index d0af06b7..d59506d9 100644 --- a/test/e2e/runner.js +++ b/test/e2e/runner.js @@ -9,7 +9,7 @@ server.listen(8080) var args = process.argv.slice(2) if (args.indexOf('--config') === -1) { - args = args.concat(['--config', 'build/nightwatch.config.js']) + args = args.concat(['--config', 'test/e2e/nightwatch.config.js']) } if (args.indexOf('--env') === -1) { args = args.concat(['--env', 'chrome,phantomjs']) diff --git a/build/karma.base.config.js b/test/unit/karma.base.config.js similarity index 87% rename from build/karma.base.config.js rename to test/unit/karma.base.config.js index 3cb321c6..68600302 100644 --- a/build/karma.base.config.js +++ b/test/unit/karma.base.config.js @@ -1,4 +1,4 @@ -var alias = require('./alias') +var alias = require('../../build/alias') var webpack = require('webpack') var webpackConfig = { @@ -31,10 +31,10 @@ var webpackConfig = { module.exports = { frameworks: ['jasmine'], files: [ - '../test/unit/index.js' + './index.js' ], preprocessors: { - '../test/unit/index.js': ['webpack', 'sourcemap'] + './index.js': ['webpack', 'sourcemap'] }, webpack: webpackConfig, webpackMiddleware: { diff --git a/build/karma.cover.config.js b/test/unit/karma.cover.config.js similarity index 84% rename from build/karma.cover.config.js rename to test/unit/karma.cover.config.js index e0823865..b3e830a4 100644 --- a/build/karma.cover.config.js +++ b/test/unit/karma.cover.config.js @@ -6,8 +6,8 @@ module.exports = function (config) { reporters: ['mocha', 'coverage'], coverageReporter: { reporters: [ - { type: 'lcov', dir: '../coverage', subdir: '.' }, - { type: 'text-summary', dir: '../coverage', subdir: '.' } + { type: 'lcov', dir: '../../coverage', subdir: '.' }, + { type: 'text-summary', dir: '../../coverage', subdir: '.' } ] }, singleRun: true, diff --git a/build/karma.dev.config.js b/test/unit/karma.dev.config.js similarity index 100% rename from build/karma.dev.config.js rename to test/unit/karma.dev.config.js diff --git a/build/karma.sauce.config.js b/test/unit/karma.sauce.config.js similarity index 100% rename from build/karma.sauce.config.js rename to test/unit/karma.sauce.config.js diff --git a/build/karma.unit.config.js b/test/unit/karma.unit.config.js similarity index 100% rename from build/karma.unit.config.js rename to test/unit/karma.unit.config.js