Skip to content

Commit 5f35705

Browse files
committed
test: Normalize vue test output, rename to avoid interfering with other test cases
1 parent c57170a commit 5f35705

File tree

3 files changed

+3
-284
lines changed

3 files changed

+3
-284
lines changed

__tests__/__snapshots__/test.js.snap

+1-280
Original file line numberDiff line numberDiff line change
@@ -1,285 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Vue file 1`] = `
4-
Array [
5-
Object {
6-
"augments": Array [],
7-
"context": Object {
8-
"file": "/Users/tmcw/p/documentation/__tests__/fixture/simple.input.vue",
9-
"loc": SourceLocation {
10-
"end": Position {
11-
"column": 1,
12-
"line": 19,
13-
},
14-
"start": Position {
15-
"column": 0,
16-
"line": 7,
17-
},
18-
},
19-
"sortKey": "!/Users/tmcw/p/documentation/__tests__/fixture/simple.input.vue 00000007",
20-
},
21-
"description": Object {
22-
"children": Array [
23-
Object {
24-
"children": Array [
25-
Object {
26-
"position": Position {
27-
"end": Object {
28-
"column": 29,
29-
"line": 1,
30-
"offset": 28,
31-
},
32-
"indent": Array [],
33-
"start": Object {
34-
"column": 1,
35-
"line": 1,
36-
"offset": 0,
37-
},
38-
},
39-
"type": "text",
40-
"value": "This Vue Component is a test",
41-
},
42-
],
43-
"position": Position {
44-
"end": Object {
45-
"column": 29,
46-
"line": 1,
47-
"offset": 28,
48-
},
49-
"indent": Array [],
50-
"start": Object {
51-
"column": 1,
52-
"line": 1,
53-
"offset": 0,
54-
},
55-
},
56-
"type": "paragraph",
57-
},
58-
],
59-
"position": Object {
60-
"end": Object {
61-
"column": 29,
62-
"line": 1,
63-
"offset": 28,
64-
},
65-
"start": Object {
66-
"column": 1,
67-
"line": 1,
68-
"offset": 0,
69-
},
70-
},
71-
"type": "root",
72-
},
73-
"errors": Array [],
74-
"examples": Array [],
75-
"loc": SourceLocation {
76-
"end": Position {
77-
"column": 3,
78-
"line": 6,
79-
},
80-
"start": Position {
81-
"column": 0,
82-
"line": 3,
83-
},
84-
},
85-
"members": Object {
86-
"events": Array [],
87-
"global": Array [],
88-
"inner": Array [],
89-
"instance": Array [],
90-
"static": Array [],
91-
},
92-
"name": "simple.input",
93-
"namespace": "simple.input",
94-
"params": Array [],
95-
"path": Array [
96-
Object {
97-
"kind": undefined,
98-
"name": "simple.input",
99-
},
100-
],
101-
"properties": Array [],
102-
"returns": Array [
103-
Object {
104-
"description": Object {
105-
"children": Array [
106-
Object {
107-
"children": Array [
108-
Object {
109-
"position": Position {
110-
"end": Object {
111-
"column": 21,
112-
"line": 1,
113-
"offset": 20,
114-
},
115-
"indent": Array [],
116-
"start": Object {
117-
"column": 1,
118-
"line": 1,
119-
"offset": 0,
120-
},
121-
},
122-
"type": "text",
123-
"value": "vue-tested component",
124-
},
125-
],
126-
"position": Position {
127-
"end": Object {
128-
"column": 21,
129-
"line": 1,
130-
"offset": 20,
131-
},
132-
"indent": Array [],
133-
"start": Object {
134-
"column": 1,
135-
"line": 1,
136-
"offset": 0,
137-
},
138-
},
139-
"type": "paragraph",
140-
},
141-
],
142-
"position": Object {
143-
"end": Object {
144-
"column": 21,
145-
"line": 1,
146-
"offset": 20,
147-
},
148-
"start": Object {
149-
"column": 1,
150-
"line": 1,
151-
"offset": 0,
152-
},
153-
},
154-
"type": "root",
155-
},
156-
"title": "returns",
157-
"type": Object {
158-
"name": "vue-tested",
159-
"type": "NameExpression",
160-
},
161-
},
162-
],
163-
"sees": Array [],
164-
"tags": Array [
165-
Object {
166-
"description": "vue-tested component",
167-
"lineNumber": 2,
168-
"title": "returns",
169-
"type": Object {
170-
"name": "vue-tested",
171-
"type": "NameExpression",
172-
},
173-
},
174-
],
175-
"throws": Array [],
176-
"todos": Array [],
177-
},
178-
Object {
179-
"augments": Array [],
180-
"context": Object {
181-
"file": "/Users/tmcw/p/documentation/__tests__/fixture/simple.input.vue",
182-
"loc": SourceLocation {
183-
"end": Position {
184-
"column": 3,
185-
"line": 17,
186-
},
187-
"start": Position {
188-
"column": 2,
189-
"line": 14,
190-
},
191-
},
192-
"sortKey": "!/Users/tmcw/p/documentation/__tests__/fixture/simple.input.vue 00000014",
193-
},
194-
"description": Object {
195-
"children": Array [
196-
Object {
197-
"children": Array [
198-
Object {
199-
"position": Position {
200-
"end": Object {
201-
"column": 17,
202-
"line": 1,
203-
"offset": 16,
204-
},
205-
"indent": Array [],
206-
"start": Object {
207-
"column": 1,
208-
"line": 1,
209-
"offset": 0,
210-
},
211-
},
212-
"type": "text",
213-
"value": "This is a number",
214-
},
215-
],
216-
"position": Position {
217-
"end": Object {
218-
"column": 17,
219-
"line": 1,
220-
"offset": 16,
221-
},
222-
"indent": Array [],
223-
"start": Object {
224-
"column": 1,
225-
"line": 1,
226-
"offset": 0,
227-
},
228-
},
229-
"type": "paragraph",
230-
},
231-
],
232-
"position": Object {
233-
"end": Object {
234-
"column": 17,
235-
"line": 1,
236-
"offset": 16,
237-
},
238-
"start": Object {
239-
"column": 1,
240-
"line": 1,
241-
"offset": 0,
242-
},
243-
},
244-
"type": "root",
245-
},
246-
"errors": Array [],
247-
"examples": Array [],
248-
"loc": SourceLocation {
249-
"end": Position {
250-
"column": 5,
251-
"line": 13,
252-
},
253-
"start": Position {
254-
"column": 2,
255-
"line": 11,
256-
},
257-
},
258-
"members": Object {
259-
"events": Array [],
260-
"global": Array [],
261-
"inner": Array [],
262-
"instance": Array [],
263-
"static": Array [],
264-
},
265-
"name": "myNumber",
266-
"namespace": "myNumber",
267-
"params": Array [],
268-
"path": Array [
269-
Object {
270-
"kind": undefined,
271-
"name": "myNumber",
272-
},
273-
],
274-
"properties": Array [],
275-
"returns": Array [],
276-
"sees": Array [],
277-
"tags": Array [],
278-
"throws": Array [],
279-
"todos": Array [],
280-
},
281-
]
282-
`;
3+
exports[`Vue file 1`] = `Array []`;
2834

2845
exports[`config 1`] = `
2856
"<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

__tests__/test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ test('.lint with bad input', async function() {
237237

238238
test('Vue file', async function() {
239239
await pify(chdir)(__dirname);
240-
const data = await documentation.build(
241-
'__tests__/fixture/simple.input.vue',
242-
{}
243-
);
240+
const data = await documentation.build('__tests__/fixture/vue.input.vue', {});
241+
normalize(data);
244242
expect(data).toMatchSnapshot();
245243
});
File renamed without changes.

0 commit comments

Comments
 (0)