Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-dart

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-dart - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

27

lib/index.js
var path = require('path');
var fs = require('fs');
var dart2jsaas = require('dart2jsaas');

@@ -16,6 +17,22 @@ var format = require('util').format;

var initDartUnittest = function(emitter, /* config.files */ files, /* config.basePath */ basePath,
/* config.karmaDartImports */ customImports, logger) {
/* config.karmaDartImports */ customImports, /* config.hostname */ hostname, /* config.port */ port,
logger, customFileHandlers) {
var log = logger.create('dart');
var dart2js = dart2jsaas.setupSystem({
fetcherBaseUrl: 'http://' + hostname + ':' + port + '/base/'
});
customFileHandlers.push({
urlRegex: /.*dart.js(\?[0-9]*)?$/,
handler: function(request, response, fa, fb, basePath) {
var base = '/base/';
dart2js(request.url.replace(base, '').replace(/\.js(\?[0-9]*)?$/, '')).then(function(outjs) {
response.writeHead(200);
response.end(outjs);
});
}
});
// include the adapter.js

@@ -39,5 +56,7 @@ files.unshift({pattern: __dirname + '/adapter.js', included: true, served: true, watched: false});

var randomUid = random();
var dartAdapterFile = {
path: basePath + '/__adapter_dart_unittest.dart',
contentPath: path.normalize(TEMP_DIR + '/karma-dart-adapter-' + random() + '.dart'),
contentPath: path.normalize(TEMP_DIR + '/karma-dart-adapter-' + randomUid + '.dart'),
isUrl: false,

@@ -79,5 +98,5 @@ mtime: new Date()

if (filePath.indexOf(basePath) === 0) {
filePath = '/base' + filePath.substr(basePath.length);
filePath = filePath.substr(basePath.length + 1);
} else {
filePath = '/absolute' + filePath;
filePath = 'absolute' + filePath;
}

@@ -84,0 +103,0 @@ testImports.push(format(DART_IMPORT, filePath, 'test_' + index));

6

package.json
{
"name": "karma-dart",
"version": "0.2.0",
"version": "0.2.1",
"description": "A Karma plugin - adapter for Dart unittest testing framework.",

@@ -20,3 +20,5 @@ "main": "lib/index.js",

},
"dependencies": {},
"dependencies": {
"dart2jsaas": "~0.0.1"
},
"devDependencies": {

@@ -23,0 +25,0 @@ "grunt-npm": "~0.0.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc