Skip to content

Commit 2d916e4

Browse files
committed
fix(cli-test-utils): fix ts declaration
the data written by fs.writeFile should be any
1 parent 49e8ab1 commit 2d916e4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/@vue/cli-test-utils/createJSONServer.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ import { Application } from 'express'
33
declare function createJSONServer(
44
/**
55
* Either a path to a json file (e.g. 'db.json') or an object in memory
6+
*
7+
* Default:
8+
*{
9+
* 'posts': [
10+
* { 'id': 1, 'title': 'json-server', 'author': 'typicode' }
11+
* ],
12+
* 'comments': [
13+
* { 'id': 1, 'body': 'some comment', 'postId': 1 }
14+
* ],
15+
* 'profile': { 'name': 'typicode' }
16+
*}
617
*/
718
data?: string | object,
819
): Application

packages/@vue/cli-test-utils/createTestProject.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ declare function createTestProject(
2020
* }
2121
*/
2222
preset: GeneratorRootOptions,
23+
/** `path.resolve(cwd, name)` will be the project's root directory */
2324
cwd?: string | null,
2425
/**
2526
* if init git repo
@@ -35,7 +36,7 @@ declare function createTestProject(
3536
/** read the content for the file */
3637
read: (file: string) => Promise<string>
3738
/** write file to project */
38-
write: (file: string, content: string) => Promise<void>
39+
write: (file: string, content: any) => Promise<void>
3940
/** execa command at root path of project */
4041
run: (command: string, args?: ReadonlyArray<string>) => execa.ExecaChildProcess
4142
/** delete the file of project */

0 commit comments

Comments
 (0)