You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Karma currently detects whether a file is binary, and does not allow binary files to be passed on to preprocessors. The code is here and reproduced below.
if (thisFileIsBinary) {
log.warn('Ignoring preprocessing (%s) %s because it is a binary file.',
config[patterns[i]].join(', '), file.originalPath)
} else {
preprocessorNames = combineLists(preprocessorNames, config[patterns[i]])
}
I'd like to propose that this restriction be removed, and allow binary files to be handled by preprocessors.
The main use case I have for this is to create a preprocessor that handles zip files containing Javascript code. In Google, due to the restriction of the build system, zip files are unavoidable, and it is not possible to extract them before running Karma. Relaxing this restriction would allow the creation of a preprocessor that handles this case.
To maintain backwards compatibility and prevent breakages, all plugins that handle binary files would
need to explicitly declare so. This can be done by adding a property handleBinaryFile = true to the
plugin. Without this flag, Karma will automatically fall back to the existing behavior - print a warning and ignore the file.
The actual code change is minimal, please see this PR.
The text was updated successfully, but these errors were encountered:
Karma currently detects whether a file is binary, and does not allow binary files to be passed on to preprocessors. The code is here and reproduced below.
I'd like to propose that this restriction be removed, and allow binary files to be handled by preprocessors.
The main use case I have for this is to create a preprocessor that handles zip files containing Javascript code. In Google, due to the restriction of the build system, zip files are unavoidable, and it is not possible to extract them before running Karma. Relaxing this restriction would allow the creation of a preprocessor that handles this case.
To maintain backwards compatibility and prevent breakages, all plugins that handle binary files would
need to explicitly declare so. This can be done by adding a property
handleBinaryFile = true
to theplugin. Without this flag, Karma will automatically fall back to the existing behavior - print a warning and ignore the file.
The actual code change is minimal, please see this PR.
The text was updated successfully, but these errors were encountered: