diff --git a/package.json b/package.json index ab8d11f2..702d3916 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "./node_modules/.bin/grunt" }, "dependencies": { - "amdetective": "0.0.2", + "amdetective": "0.2.1", "coffee-script": "1.3.3", "colors": "^1.1.2", "commander": "^2.8.1", diff --git a/test/amd.js b/test/amd.js index f52fb4ef..a7ff075c 100644 --- a/test/amd.js +++ b/test/amd.js @@ -118,4 +118,10 @@ describe('module format (AMD)', function () { findNestedDependencies: true }).obj().should.eql({ 'main': ['a', 'b'] }); }); + + it('should work for amd files with es6 code inside', function () { + madge([__dirname + '/files/amd/amdes6.js'], { + format: 'amd' + }).obj().should.eql({ 'amdes6': ['ok/a'] }); + }); }); diff --git a/test/files/amd/amdes6.js b/test/files/amd/amdes6.js new file mode 100644 index 00000000..a68152f4 --- /dev/null +++ b/test/files/amd/amdes6.js @@ -0,0 +1,13 @@ +define([ + 'ok/a' +], function(a) { + 'use strict'; + + var x = [1,2,3,4] + + for (var i of x) { + x++; + } + + return x; +});