Skip to content

Commit

Permalink
Updated the browser testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Jun 20, 2019
1 parent 54feff7 commit 6bca6ea
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
3 changes: 3 additions & 0 deletions etc/eslint.json
Expand Up @@ -6,6 +6,9 @@
"node": true
},
"extends": "eslint:recommended",
"globals": {
"expect": "readonly"
},
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
Expand Down
20 changes: 3 additions & 17 deletions etc/karma.js
@@ -1,25 +1,11 @@
const {normalize, resolve} = require('path');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');

module.exports = config => config.set({
basePath: resolve(__dirname, '..'),
basePath: require('path').resolve(__dirname, '..'),
browsers: ['FirefoxHeadless'],
files: [
{pattern: 'lib/**/*.js', type: 'module'},
{pattern: 'test/**/*.js', type: 'module'}
],
frameworks: ['mocha'],
preprocessors: {
'test/**/*.js': ['rollup']
},
frameworks: ['mocha', 'chai'],
reporters: ['progress'],
rollupPreprocessor: {
onwarn: (warning, warn) => {
if (warning.code == 'CIRCULAR_DEPENDENCY' && warning.importer.includes(normalize('node_modules/chai'))) return;
warn(warning);
},
output: {extend: true, format: 'iife', name: 'window'},
plugins: [nodeResolve(), commonjs()]
},
singleRun: true
});
2 changes: 1 addition & 1 deletion etc/mocha.json
Expand Up @@ -2,6 +2,6 @@
"check-leaks": true,
"recursive": true,
"reporter": "spec",
"require": "esm",
"require": ["esm", "chai/register-expect"],
"ui": "bdd"
}
6 changes: 2 additions & 4 deletions package.json
Expand Up @@ -23,14 +23,12 @@
"gulp": "^4.0.2",
"jsdoc": "^3.6.2",
"karma": "^4.1.0",
"karma-chai": "^0.1.0",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-rollup-preprocessor": "^7.0.0",
"mocha": "^6.1.4",
"nyc": "^14.1.1",
"rollup": "^1.15.6",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-node-resolve": "^5.0.3"
"rollup": "^1.15.6"
},
"engines": {
"node": ">=12.4.0",
Expand Down
3 changes: 0 additions & 3 deletions test/enum_test.js
@@ -1,4 +1,3 @@
import chai from 'chai';
import {Enum} from '../lib/index.js';

/**
Expand All @@ -14,8 +13,6 @@ const SampleEnum = Enum.create({

/** Tests the features of the {@link Enum} class. */
describe('EnumTest', () => {
const {expect} = chai;

describe('#assert()', () => {
it('should return the specified value if it is a known one', () => {
expect(SampleEnum.assert(false)).to.equal(SampleEnum.zero);
Expand Down

0 comments on commit 6bca6ea

Please sign in to comment.