@@ -33,6 +33,141 @@ Array [
3333]
3434` ;
3535
36+ exports [` the patch parser parses old-style patches 1` ] = `
37+ Array [
38+ Object {
39+ " afterHash" : null ,
40+ " beforeHash" : null ,
41+ " hunks" : Array [
42+ Object {
43+ " header" : Object {
44+ " original" : Object {
45+ " length" : 10 ,
46+ " start" : 41 ,
47+ },
48+ " patched" : Object {
49+ " length" : 11 ,
50+ " start" : 41 ,
51+ },
52+ },
53+ " parts" : Array [
54+ Object {
55+ " lines" : Array [
56+ " */" ,
57+ " function isValidNameError(name, node) {" ,
58+ " !(typeof name === 'string') ? (0, _invariant2.default)(0, 'Expected string') : void 0;" ,
59+ ],
60+ " noNewlineAtEndOfFile" : false ,
61+ " type" : " context" ,
62+ },
63+ Object {
64+ " lines" : Array [
65+ " if (name.length > 1 && name[0] === '_' && name[1] === '_') {" ,
66+ " return new _GraphQLError.GraphQLError('Name \\ " ' + name + ' \\" must not begin with \\ " __ \\" , which is reserved by ' + 'GraphQL introspection.', node);" ,
67+ " }" ,
68+ ],
69+ " noNewlineAtEndOfFile" : false ,
70+ " type" : " deletion" ,
71+ },
72+ Object {
73+ " lines" : Array [
74+ " // if (name.length > 1 && name[0] === '_' && name[1] === '_') {" ,
75+ " // return new _GraphQLError.GraphQLError('Name \\ " ' + name + ' \\" must not begin with \\ " __ \\" , which is reserved by ' + 'GraphQL introspection.', node);" ,
76+ " // }" ,
77+ ],
78+ " noNewlineAtEndOfFile" : false ,
79+ " type" : " insertion" ,
80+ },
81+ Object {
82+ " lines" : Array [
83+ " if (!NAME_RX.test(name)) {" ,
84+ " return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \\ " ' + name + ' \\" does not.', node);" ,
85+ " }" ,
86+ ],
87+ " noNewlineAtEndOfFile" : false ,
88+ " type" : " context" ,
89+ },
90+ Object {
91+ " lines" : Array [
92+ " " ,
93+ ],
94+ " noNewlineAtEndOfFile" : false ,
95+ " type" : " insertion" ,
96+ },
97+ Object {
98+ " lines" : Array [
99+ " }" ,
100+ ],
101+ " noNewlineAtEndOfFile" : true ,
102+ " type" : " context" ,
103+ },
104+ ],
105+ },
106+ ],
107+ " path" : " node_modules/graphql/utilities/assertValidName.js" ,
108+ " type" : " patch" ,
109+ } ,
110+ Object {
111+ " afterHash" : null ,
112+ " beforeHash" : null ,
113+ " hunks" : Array [
114+ Object {
115+ " header" : Object {
116+ " original" : Object {
117+ " length" : 9 ,
118+ " start" : 29 ,
119+ },
120+ " patched" : Object {
121+ " length" : 9 ,
122+ " start" : 29 ,
123+ },
124+ },
125+ " parts" : Array [
126+ Object {
127+ " lines" : Array [
128+ " */" ,
129+ " export function isValidNameError(name, node) {" ,
130+ " !(typeof name === 'string') ? invariant(0, 'Expected string') : void 0;" ,
131+ ],
132+ " noNewlineAtEndOfFile" : false ,
133+ " type" : " context" ,
134+ },
135+ Object {
136+ " lines" : Array [
137+ " if (name.length > 1 && name[0] === '_' && name[1] === '_') {" ,
138+ " return new GraphQLError('Name \\ " ' + name + ' \\" must not begin with \\ " __ \\" , which is reserved by ' + 'GraphQL introspection.', node);" ,
139+ " }" ,
140+ ],
141+ " noNewlineAtEndOfFile" : false ,
142+ " type" : " deletion" ,
143+ },
144+ Object {
145+ " lines" : Array [
146+ " // if (name.length > 1 && name[0] === '_' && name[1] === '_') {" ,
147+ " // return new GraphQLError('Name \\ " ' + name + ' \\" must not begin with \\ " __ \\" , which is reserved by ' + 'GraphQL introspection.', node);" ,
148+ " // }" ,
149+ ],
150+ " noNewlineAtEndOfFile" : false ,
151+ " type" : " insertion" ,
152+ },
153+ Object {
154+ " lines" : Array [
155+ " if (!NAME_RX.test(name)) {" ,
156+ " return new GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \\ " ' + name + ' \\" does not.', node);" ,
157+ " }" ,
158+ ],
159+ " noNewlineAtEndOfFile" : false ,
160+ " type" : " context" ,
161+ },
162+ ],
163+ },
164+ ],
165+ " path" : " node_modules/graphql/utilities/assertValidName.mjs" ,
166+ " type" : " patch" ,
167+ } ,
168+ ]
169+ ` ;
170+
36171exports [` the patch parser works 1` ] = `
37172Array [
38173 Object {
0 commit comments