The files
array determines which files are included in the browser and which files are watched and served by Karma.
basePath
#basePath
first.basePath
is a relative path, it gets resolved to the
directory where the configuration file is.test/unit/**/*.spec.js
.Each pattern is either a simple string or an object with four properties:
pattern
#watched
#true
autoWatch
is true
all files that have set watched
to true will be
watched for changes.included
#true
<script>
tag? Use false
if you wanna load them manually, eg.
using Require.js.served
#true
Depending on preprocessor configuration, be aware that files loaded may be transformed and no longer available in
their native format. For instance, if html2js preprocessor is enabled, the actual .html files are no longer
served - but rather available as window.__html__['my.html']
. Read more about preprocessors.
Here is a complete example showing the different options that are possible.
files: [
// simple patterns to load the needed testfiles
// equals to {pattern: 'test/unit/*.spec.js', watched: true, served: true, included: true}
'test/unit/*.spec.js',
// this file gets served but will be ignored by the watcher
// note if html2js preprocessor is active, reference as `window.__html__['compiled/index.html']`
{pattern: 'compiled/index.html', watched: false},
// this file only gets watched but otherwise ignored
{pattern: 'app/index.html', included: false, served: false}
],