Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
test: improve config
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 12, 2019
1 parent a09eed7 commit c931607
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
27 changes: 15 additions & 12 deletions test/karma.conf.js → karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const puppeteer = require('puppeteer');
const rollupConfig = require('../rollup.config');

process.env.CHROME_BIN = puppeteer.executablePath();
process.env.NODE_ENV = 'test';

module.exports = (config) => {
config.set({
autoWatch: false,
basePath: '..',
browsers: ['ChromeHeadlessWithoutSandbox'],
customLaunchers: {
ChromeHeadlessWithoutSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
browsers: ['ChromeHeadless'],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
},
files: [
'node_modules/jquery/dist/jquery.js',
'dist/cropper.js',
'dist/cropper.css',
'test/index.js',
{
Expand All @@ -28,12 +25,18 @@ module.exports = (config) => {
preprocessors: {
'test/index.js': ['rollup'],
},
reporters: ['mocha'],
reporters: ['mocha', 'coverage-istanbul'],
rollupPreprocessor: {
plugins: rollupConfig.plugins,
output: {
format: 'iife',
name: 'Anonymous',
sourcemap: 'inline',
},
plugins: [
nodeResolve(),
commonjs(),
babel(),
],
},
singleRun: true,
});
Expand Down
12 changes: 0 additions & 12 deletions test/.eslintrc

This file was deleted.

0 comments on commit c931607

Please sign in to comment.