Skip to content

Commit

Permalink
Support passing isBinary in config file list
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed Aug 15, 2022
1 parent 84f7cc3 commit 6e1e12c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/config/02-files.md
Expand Up @@ -59,6 +59,11 @@ The `files` array determines which files are included in the browser, watched, a
* **Default.** `undefined`
* **Description.** Set the `integrity` HTML attribute value to the `<script>` or the `<link>` tag to load the resource that matches the given pattern if the pattern is an absolute URL.

### `isBinary`
* **Type.** Boolean
* **Default.** `undefined`
* **Description.** Are these binary files? Non-binary files are internally converted to UTF-8 strings to go through preprocessors. Karma tries to automatically infer whether a file is binary, but the heuristics might fail if e.g. the file contains many valid ASCII characters.

## Pattern matching and `basePath`
- All of the relative patterns will get resolved using the `basePath` first.
- If the `basePath` is a relative path, it gets resolved to the
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Expand Up @@ -63,7 +63,7 @@ function createPatternObject (pattern) {
} else if (helper.isObject(pattern) && pattern.pattern && helper.isString(pattern.pattern)) {
return helper.isUrlAbsolute(pattern.pattern)
? new UrlPattern(pattern.pattern, pattern.type)
: new Pattern(pattern.pattern, pattern.served, pattern.included, pattern.watched, pattern.nocache, pattern.type)
: new Pattern(pattern.pattern, pattern.served, pattern.included, pattern.watched, pattern.nocache, pattern.type, pattern.isBinary)
} else {
log.warn(`Invalid pattern ${pattern}!\n\tExpected string or object with "pattern" property.`)
return new Pattern(null, false, false, false, false)
Expand Down

0 comments on commit 6e1e12c

Please sign in to comment.