ng-test-utils
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "ng-test-utils", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "angular test utilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,3 @@ | ||
var hasAnnotation = require('../utils/hasAnnotation'); | ||
module.exports = createInjector(); | ||
@@ -10,5 +12,8 @@ module.exports.create = createInjector; | ||
regexp = regexp || /^\s*@ngProvide\s*$/; | ||
var needsInjection = require('./needsInjection').create(regexp, logger); | ||
var buildInjection = require('./buildNgProvideHandler'); | ||
var collectVariableIdsAndInits = require('./collectVariableIdsAndInits'); | ||
var hasNgProvideAnnotation = hasAnnotation(regexp); | ||
@@ -38,2 +43,16 @@ return addVariableInjections; | ||
return false; | ||
}, | ||
visitAssignmentExpression: function(path) { | ||
var node = path.node; | ||
var parent = path.parent, parentNode = parent && parent.node; | ||
if( | ||
parentNode && | ||
n.ExpressionStatement.check(parentNode) && | ||
hasNgProvideAnnotation(parentNode) | ||
){ | ||
var injection = buildInjection([node.left], [node.right]); | ||
injection.comments = parentNode.comments; | ||
parent.replace(injection); | ||
} | ||
return false; | ||
} | ||
@@ -40,0 +59,0 @@ }); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15012
432
0