snyk-go-plugin
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -62,3 +62,8 @@ var fs = require('fs'); | ||
pkg.version = (isRoot ? '0.0.0' : depLocks[pkg.name].version); | ||
if (isRoot) { | ||
pkg.version = '0.0.0'; | ||
} else { | ||
pkg.version = depLocks[pkg.name] ? depLocks[pkg.name].version : ''; | ||
} | ||
pkg.from = fromPath.concat(pkg.name + '@' + pkg.version) | ||
@@ -65,0 +70,0 @@ |
@@ -12,3 +12,3 @@ { | ||
"lint": "jscs `find ./lib -name '*.js'` -v && jscs `find ./test -name '*.js'` -v", | ||
"test": "tap -R=spec `find ./test -name '*.test.js'`", | ||
"test": "tap `find ./test -name '*.test.js'`", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post", | ||
@@ -29,3 +29,3 @@ "watch": "nodemon -x 'npm test'" | ||
}, | ||
"version": "1.1.1" | ||
"version": "1.1.2" | ||
} |
@@ -73,2 +73,51 @@ var test = require('tap').test; | ||
test('pkg with local import', function (t) { | ||
chdirToPkg(['path', 'to', 'pkg-with-local-import']); | ||
return plugin.inspect('.', 'Gopkg.lock') | ||
.then(function (result) { | ||
var plugin = result.plugin; | ||
var pkg = result.package; | ||
t.test('plugin', function (t) { | ||
t.ok(plugin, 'plugin'); | ||
t.equal(plugin.name, 'snyk-go-plugin', 'name'); | ||
t.end(); | ||
}); | ||
t.test('dependencies', function (t) { | ||
var deps = pkg.dependencies; | ||
t.match(deps['path/to/pkg-with-local-import/subpkg'], { | ||
version: '', | ||
dependencies: { | ||
'gitpub.com/meal/dinner': { | ||
version: 'v0.0.7', | ||
dependencies: { | ||
'gitpub.com/food/salad': { | ||
version: 'v1.3.7', | ||
dependencies: { | ||
'gitpub.com/nature/vegetables/tomato': { | ||
version: '#b6ffb7d62206806b573348160795ea16a00940a6', | ||
from: [ | ||
'path/to/pkg-with-local-import@0.0.0', | ||
'path/to/pkg-with-local-import/subpkg@', | ||
'gitpub.com/meal/dinner@v0.0.7', | ||
'gitpub.com/food/salad@v1.3.7', | ||
'gitpub.com/nature/vegetables/tomato@#b6ffb7d62206806b573348160795ea16a00940a6', // jscs:ignore maximumLineLength | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, 'local subpkg is a dep with no version'); | ||
t.end(); | ||
}); | ||
}); | ||
}); | ||
test('missing vendor/ folder', function (t) { | ||
@@ -75,0 +124,0 @@ chdirToPkg(['path', 'to', 'pkg-with-missing-vendor-folder']); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
22462
37
613