Skip to content

Commit e1ea02c

Browse files
authored
test(parser): squash test data for yarn (#6203)
1 parent 64926d8 commit e1ea02c

17 files changed

+335
-37958
lines changed

pkg/dependency/parser/nodejs/yarn/parse_test.go

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -259,68 +259,26 @@ func TestParse(t *testing.T) {
259259
wantDeps []types.Dependency
260260
}{
261261
{
262-
name: "normal",
263-
file: "testdata/yarn_normal.lock",
264-
want: yarnNormal,
265-
wantDeps: yarnNormalDeps,
266-
},
267-
{
268-
name: "react",
269-
file: "testdata/yarn_react.lock",
270-
want: yarnReact,
271-
wantDeps: yarnReactDeps,
272-
},
273-
{
274-
name: "yarn with dev",
275-
file: "testdata/yarn_with_dev.lock",
276-
want: yarnWithDev,
277-
wantDeps: yarnWithDevDeps,
278-
},
279-
{
280-
name: "yarn many",
281-
file: "testdata/yarn_many.lock",
282-
want: yarnMany,
283-
wantDeps: yarnManyDeps,
284-
},
285-
{
286-
name: "yarn real world",
287-
file: "testdata/yarn_realworld.lock",
288-
want: yarnRealWorld,
289-
wantDeps: yarnRealWorldDeps,
262+
name: "happy",
263+
file: "testdata/yarn_happy.lock",
264+
want: yarnHappy,
265+
wantDeps: yarnHappyDeps,
290266
},
291267
{
292268
file: "testdata/yarn_with_npm.lock",
293269
want: yarnWithNpm,
294270
},
295271
{
296-
name: "yarn v2 normal",
297-
file: "testdata/yarn_v2_normal.lock",
298-
want: yarnV2Normal,
299-
wantDeps: yarnV2NormalDeps,
300-
},
301-
{
302-
name: "yarn v2 react",
303-
file: "testdata/yarn_v2_react.lock",
304-
want: yarnV2React,
305-
wantDeps: yarnV2ReactDeps,
306-
},
307-
{
308-
name: "yarn v2 with dev",
309-
file: "testdata/yarn_v2_with_dev.lock",
310-
want: yarnV2WithDev,
311-
wantDeps: yarnV2WithDevDeps,
312-
},
313-
{
314-
name: "yarn v2 many",
315-
file: "testdata/yarn_v2_many.lock",
316-
want: yarnV2Many,
317-
wantDeps: yarnV2ManyDeps,
272+
name: "happy v2",
273+
file: "testdata/yarn_v2_happy.lock",
274+
want: yarnV2Happy,
275+
wantDeps: yarnV2HappyDeps,
318276
},
319277
{
320278
name: "yarn with local dependency",
321279
file: "testdata/yarn_with_local.lock",
322-
want: yarnNormal,
323-
wantDeps: yarnNormalDeps,
280+
want: yarnWithLocal,
281+
wantDeps: yarnWithLocalDeps,
324282
},
325283
{
326284
name: "yarn v2 with protocols in dependency section",

pkg/dependency/parser/nodejs/yarn/parse_testcase.go

Lines changed: 67 additions & 15799 deletions
Large diffs are not rendered by default.

pkg/dependency/parser/nodejs/yarn/testcase_deps_generator/Dockerfile

Lines changed: 0 additions & 5 deletions
This file was deleted.

pkg/dependency/parser/nodejs/yarn/testcase_deps_generator/index.js

Lines changed: 0 additions & 80 deletions
This file was deleted.

pkg/dependency/parser/nodejs/yarn/testcase_deps_generator/package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

pkg/dependency/parser/nodejs/yarn/testcase_deps_generator/yarn.lock

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4":
5+
version "7.4.4"
6+
resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2"
7+
integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q==
8+
dependencies:
9+
lodash "^4.17.11"
10+
11+
ansi-regex@^2.0.0:
12+
version "2.1.1"
13+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
14+
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
15+
16+
ansi-regex@^3.0.0:
17+
version "3.0.0"
18+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
19+
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
20+
21+
asap@~2.0.6:
22+
version "2.0.6"
23+
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
24+
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
25+
26+
inherits@2, [email protected]:
27+
version "2.0.3"
28+
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
29+
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
30+
31+
is-fullwidth-code-point@^2.0.0:
32+
version "2.0.0"
33+
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
34+
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
35+
36+
"js-tokens@^3.0.0 || ^4.0.0":
37+
version "4.0.0"
38+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
39+
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
40+
41+
jquery@^3.4.1:
42+
version "3.4.1"
43+
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
44+
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
45+
46+
[email protected], lodash@^4.0.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0:
47+
version "4.17.11"
48+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
49+
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
50+
51+
promise@^8.0.3:
52+
version "8.0.3"
53+
resolved "https://registry.yarnpkg.com/promise/-/promise-8.0.3.tgz#f592e099c6cddc000d538ee7283bb190452b0bf6"
54+
integrity sha512-HeRDUL1RJiLhyA0/grn+PTShlBAcLuh/1BJGtrvjwbvRDCTLLMEz9rOGCV+R3vHY4MixIuoMEd9Yq/XvsTPcjw==
55+
dependencies:
56+
asap "~2.0.6"
57+
58+
[email protected], safe-buffer@^5.0.1, safe-buffer@^5.1.2:
59+
version "5.1.2"
60+
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
61+
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
62+
63+
"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
64+
version "2.1.2"
65+
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
66+
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
67+
68+
"statuses@>= 1.4.0 < 2":
69+
version "1.5.0"
70+
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
71+
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
72+
73+
"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1:
74+
version "2.1.1"
75+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
76+
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
77+
dependencies:
78+
is-fullwidth-code-point "^2.0.0"
79+
strip-ansi "^4.0.0"
80+
81+
82+
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
83+
version "3.0.1"
84+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
85+
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
86+
dependencies:
87+
ansi-regex "^2.0.0"
88+
89+
strip-ansi@^4.0.0:
90+
version "4.0.0"
91+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
92+
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
93+
dependencies:
94+
ansi-regex "^3.0.0"
95+
96+
whatwg-fetch@>=0.10.0:
97+
version "3.0.0"
98+
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
99+
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
100+
101+
102+
version "1.1.3"
103+
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
104+
integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
105+
dependencies:
106+
string-width "^1.0.2 || 2"

0 commit comments

Comments
 (0)