github.com/jfrog/jfrog-cli-core@v1.12.1/artifactory/commands/npm/publish_test.go (about) 1 package npm 2 3 import ( 4 "path/filepath" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestReadPackageInfoFromTarball(t *testing.T) { 11 npmPublish := NewNpmPublishCommand() 12 npmPublish.packedFilePath = filepath.Join("..", "testdata", "npm", "npm-example-0.0.3.tgz") 13 err := npmPublish.readPackageInfoFromTarball() 14 assert.NoError(t, err) 15 16 assert.Equal(t, "npm-example", npmPublish.packageInfo.Name) 17 assert.Equal(t, "0.0.3", npmPublish.packageInfo.Version) 18 }