Skip to content

Instantly share code, notes, and snippets.

@matrunchyk
Created March 27, 2017 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matrunchyk/31f910a35a2d149305af72c7aa113be2 to your computer and use it in GitHub Desktop.
Save matrunchyk/31f910a35a2d149305af72c7aa113be2 to your computer and use it in GitHub Desktop.
Laravel + VueJS + Karma
// This file is specified to load ing karma.conf.js (Files section)
// @see https://gist.github.com/matrunchyk/a79accea739f586074e005e0542200ea
//
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
// Function.prototype.bind = require('function-bind');
require('babel-polyfill');
// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs', true, /\.spec$/);
testsContext.keys().forEach(testsContext);
// require all example files except main.js for COVERAGE ONLY.
// you can also change this to match only the subset of files that
// you want coverage for.
const srcContext = require.context('/path/to/your/src/', true, /^\.\/(?!main(\.js)?$)/);
srcContext.keys().forEach(srcContext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment