karma-dart
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -34,3 +34,3 @@ var fs = require('fs'); | ||
var initDartUnittest = function(files, webServer, customFileHandlers, | ||
customScriptTypes) { | ||
customScriptTypes, karmaDartImports) { | ||
customScriptTypes.push({ | ||
@@ -41,2 +41,17 @@ extension: 'dart', | ||
var imports = { | ||
unittest: 'package:unittest/unittest.dart', | ||
js: 'package:js/js.dart' | ||
}; | ||
if (karmaDartImports) { | ||
Object.keys(karmaDartImports).forEach(function(library) { | ||
imports[library] = karmaDartImports[library]; | ||
}); | ||
} | ||
var adapterImports = ''; | ||
Object.keys(imports).forEach(function(library) { | ||
adapterImports += 'import "' + imports[library] + '" as ' + library + ';\n'; | ||
}); | ||
// We monkey-patch webServer.updateFilesPromise and modify the list of | ||
@@ -80,3 +95,5 @@ // included files to remove dart test files, and add the adapter file. | ||
response, function(data, response) { | ||
return data.replace('/*%TEST_IMPORTS%*/', imports.join('\n')) | ||
return data | ||
.replace('/*%ADAPTER_IMPORTS%*/', adapterImports) | ||
.replace('/*%TEST_IMPORTS%*/', imports.join('\n')) | ||
.replace('/*%TEST_MAIN_CALLS%*/', mainCalls.join('\n')); | ||
@@ -101,3 +118,3 @@ }); | ||
initDartUnittest.$inject = ['config.files', 'webServer', 'customFileHandlers', | ||
'customScriptTypes']; | ||
'customScriptTypes', 'config.karmaDartImports']; | ||
@@ -104,0 +121,0 @@ module.exports = { |
{ | ||
"name": "karma-dart", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A Karma plugin - adapter for Dart unittest testing framework.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22395
13
214