diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 3f26d66..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true, - "expect": true, - "should": true, - "__static": true - } -} diff --git a/test/e2e/index.js b/test/e2e/index.js deleted file mode 100644 index af4b0e7..0000000 --- a/test/e2e/index.js +++ /dev/null @@ -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') diff --git a/test/e2e/specs/Launch.spec.js b/test/e2e/specs/Launch.spec.js deleted file mode 100644 index 431116b..0000000 --- a/test/e2e/specs/Launch.spec.js +++ /dev/null @@ -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('picgo') - }) - }) -}) diff --git a/test/e2e/utils.js b/test/e2e/utils.js deleted file mode 100644 index 7d4e0da..0000000 --- a/test/e2e/utils.js +++ /dev/null @@ -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() - } -} diff --git a/test/unit/index.js b/test/unit/index.js deleted file mode 100644 index f07be98..0000000 --- a/test/unit/index.js +++ /dev/null @@ -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)?$)/) -srcContext.keys().forEach(srcContext) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js deleted file mode 100644 index 6204011..0000000 --- a/test/unit/karma.conf.js +++ /dev/null @@ -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 - } - }) -} diff --git a/test/unit/specs/LandingPage.spec.js b/test/unit/specs/LandingPage.spec.js deleted file mode 100644 index 7cea66f..0000000 --- a/test/unit/specs/LandingPage.spec.js +++ /dev/null @@ -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!') - }) -})