Skip to content

Commit c94e441

Browse files
committed
Add package manager tests
1 parent bc85b7e commit c94e441

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

cmd/diagnose_test.go

+64-1
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,75 @@ func TestDiagnose_newDiagnoseCmd(t *testing.T) {
216216
wantErr bool
217217
}{
218218
{
219-
name: "no problems",
219+
name: "bundler with no problems",
220220
command: "--package bundler --file ruby/bundler/testdata/Gemfile.lock",
221221
wantOutWriter: "",
222222
wantErrWriter: "",
223223
wantErr: false,
224224
},
225+
{
226+
name: "yarn",
227+
command: "--package yarn --file nodejs/yarn/testdata/yarn.lock",
228+
wantOutWriter: "",
229+
wantErrWriter: "",
230+
wantErr: false,
231+
},
232+
{
233+
name: "npm",
234+
command: "--package npm --file nodejs/npm/testdata/package-lock.json",
235+
wantOutWriter: "",
236+
wantErrWriter: "",
237+
wantErr: false,
238+
},
239+
{
240+
name: "pip",
241+
command: "--package pip --file python/pip/testdata/requirements.txt",
242+
wantOutWriter: "",
243+
wantErrWriter: "",
244+
wantErr: false,
245+
},
246+
{
247+
name: "pipenv",
248+
command: "--package pipenv --file python/pipenv/testdata/Pipfile.lock",
249+
wantOutWriter: "",
250+
wantErrWriter: "has error",
251+
wantErr: true,
252+
},
253+
{
254+
name: "golang",
255+
command: "--package golang --file golang/mod/testdata/go.mod",
256+
wantOutWriter: "",
257+
wantErrWriter: "has error",
258+
wantErr: true,
259+
},
260+
{
261+
name: "cargo",
262+
command: "--package cargo --file rust/cargo/testdata/cargo.lock",
263+
wantOutWriter: "",
264+
wantErrWriter: "has error",
265+
wantErr: true,
266+
},
267+
{
268+
name: "cocoapods",
269+
command: "--package cocoapods --file swift/cocoapods/testdata/Podfile.lock",
270+
wantOutWriter: "",
271+
wantErrWriter: "has error",
272+
wantErr: true,
273+
},
274+
{
275+
name: "pub",
276+
command: "--package pub --file dart/pub/testdata/podspec.lock",
277+
wantOutWriter: "",
278+
wantErrWriter: "has error",
279+
wantErr: true,
280+
},
281+
{
282+
name: "mix",
283+
command: "--package mix --file erlang_elixir/hex/testdata/mix.lock",
284+
wantOutWriter: "",
285+
wantErrWriter: "",
286+
wantErr: false,
287+
},
225288
{
226289
name: "has error",
227290
command: "--package bundler --file ruby/bundler/testdata/Gemfile_error.lock",

0 commit comments

Comments
 (0)