Merge pull request #955 from h3poteto/clean/test

Remove unused tests and packages
This commit is contained in:
AkiraFukushima 2019-07-08 22:48:59 +09:00 committed by GitHub
commit 7f6128fe72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 8 additions and 1286 deletions

View File

@ -1,3 +1,2 @@
test/unit/coverage/**
test/unit/*.js
test/e2e/*.js
node_modules/*
dist/*

1116
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,9 +21,8 @@
"main": "./dist/electron/main.js",
"scripts": {
"dev": "node .electron-vue/dev-runner.js",
"e2e": "npm run pack && mocha test/e2e",
"lint": "eslint --ext .js,.vue,.ts -f ./node_modules/eslint-friendly-formatter src spec",
"lint:fix": "eslint --ext .js,.vue,.ts -f ./node_modules/eslint-friendly-formatter --fix src test",
"lint:fix": "eslint --ext .js,.vue,.ts -f ./node_modules/eslint-friendly-formatter --fix src spec",
"stylelint": "stylelint '**/*.vue' --syntax scss",
"build": "node .electron-vue/build.js",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
@ -32,7 +31,7 @@
"build:linux": "npm run build && npm run package:linux",
"build:win32": "npm run build && npm run package:win32",
"build:win64": "npm run build && npm run package:win64",
"build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=4.2.4 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/test' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
"build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=4.2.4 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
"package:mac": "electron-builder --mac --x64",
"package:linux": "electron-builder --linux",
"package:win32": "electron-builder --win --ia32",
@ -40,8 +39,6 @@
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --mode production --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --mode production --progress --colors --config .electron-vue/webpack.renderer.config.js",
"test": "npm run unit && npm run e2e",
"unit": "karma start test/unit/karma.conf.js",
"postinstall": "npm run lint:fix",
"spec": "NODE_ENV=test jest -u --maxWorkers=3"
},
@ -213,7 +210,7 @@
"@typescript-eslint/eslint-plugin": "^1.5.0",
"@typescript-eslint/parser": "^1.5.0",
"@typescript-eslint/typescript-estree": "^1.5.0",
"@vue/test-utils": "^1.0.0-beta.28",
"@vue/test-utils": "^1.0.0-beta.29",
"ajv": "^6.6.1",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0",
@ -234,7 +231,6 @@
"electron-builder": "^20.44.4",
"electron-debug": "^2.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-ipc-mock": "0.0.3",
"electron-mock-ipc": "^0.1.3",
"electron-packager": "^14.0.1",
"eslint": "^5.16.0",
@ -253,16 +249,7 @@
"html-webpack-plugin": "^3.2.0",
"jest": "^24.5.0",
"jsdom": "^13.0.0",
"karma": "^3.1.3",
"karma-chai": "^0.1.0",
"karma-coverage": "^1.1.2",
"karma-electron": "^6.0.0",
"karma-mocha": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "^4.0.0-rc.5",
"mini-css-extract-plugin": "^0.4.5",
"mocha": "^5.2.0",
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"node-sass": "^4.12.0",

View File

@ -3,7 +3,6 @@ linter:
npm_install: true
dir:
- src
- test
- spec
options:
config: '.eslintrc.js'

View File

@ -1,11 +0,0 @@
{
"env": {
"mocha": true
},
"globals": {
"assert": true,
"expect": true,
"should": true,
"__static": true
}
}

View File

@ -1,18 +0,0 @@
'use strict'
// Set BABEL_ENV to use proper env config
process.env.BABEL_ENV = 'test'
// Enable use of ES6+ on required files
require('babel-register')({
ignore: /node_modules/
})
// Attach Chai APIs to global scope
const { expect, should, assert } = require('chai')
global.expect = expect
global.should = should
global.assert = assert
// Require all JS files in `./specs` for Mocha to consume
require('require-dir')('./specs')

View File

@ -1,13 +0,0 @@
import utils from '../utils'
describe('Launch', function () {
beforeEach(utils.beforeEach)
afterEach(utils.afterEach)
it('shows the proper application title', function () {
return this.app.client.getTitle()
.then(title => {
expect(title).to.equal('whalebird')
})
})
})

View File

@ -1,23 +0,0 @@
import electron from 'electron'
import { Application } from 'spectron'
export default {
afterEach () {
this.timeout(10000)
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
},
beforeEach () {
this.timeout(10000)
this.app = new Application({
path: electron,
args: ['dist/electron/main.js'],
startTimeout: 10000,
waitTimeout: 10000
})
return this.app.start()
}
}

View File

@ -1,13 +0,0 @@
import Vue from 'vue'
Vue.config.devtools = false
Vue.config.productionTip = false
// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs', true, /\.spec$/)
testsContext.keys().forEach(testsContext)
// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
const srcContext = require.context('../../src/renderer', true, /^(?!.*(main\.js|~|\.scss)).*$/)
srcContext.keys().forEach(srcContext)

View File

@ -1,62 +0,0 @@
'use strict'
const path = require('path')
const merge = require('webpack-merge')
const webpack = require('webpack')
const baseConfig = require('../../.electron-vue/webpack.renderer.config')
const projectRoot = path.resolve(__dirname, '../../src/renderer')
// Set BABEL_ENV to use proper preset config
process.env.BABEL_ENV = 'test'
let webpackConfig = merge(baseConfig, {
devtool: '#inline-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"testing"'
})
]
})
// don't treat dependencies as externals
delete webpackConfig.entry
delete webpackConfig.externals
delete webpackConfig.output.libraryTarget
// apply vue option to apply isparta-loader on js
webpackConfig.module.rules
.find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'
module.exports = config => {
config.set({
browsers: ['visibleElectron'],
client: {
useIframe: false
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }
]
},
customLaunchers: {
'visibleElectron': {
base: 'Electron',
flags: ['--show']
}
},
frameworks: ['mocha', 'chai'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
reporters: ['spec', 'coverage'],
singleRun: true,
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
}
})
}

View File

@ -1,13 +0,0 @@
// import Vue from 'vue'
// import LandingPage from '@/components/LandingPage'
// describe('LandingPage.vue', () => {
// it('should render correct contents', () => {
// const vm = new Vue({
// el: document.createElement('div'),
// render: h => h(LandingPage)
// }).$mount()
// expect(vm.$el.querySelector('.title').textContent).to.contain('Welcome to your new project!')
// })
// })