Created
August 30, 2018 10:56
-
-
Save tanhauhau/e9acf905fefd2d9b2c7ea58635d7ea47 to your computer and use it in GitHub Desktop.
Test Manta Style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface User { | |
/** | |
* @faker {{internet.userName}} | |
*/ | |
userName: string; | |
gender: 0; | |
/** | |
* @faker date.past | |
*/ | |
birthday: number; | |
/** | |
* @range 5 10 | |
*/ | |
age: number; | |
/** | |
* @faker {{address.country}} | |
*/ | |
country: string; | |
/** | |
* @faker {{address.state}} | |
*/ | |
state: string; | |
/** | |
* @faker {{address.city}} | |
*/ | |
city: string; | |
/** | |
* @iterate Happy | |
* @iterate Birthday | |
* @iterate To | |
* @iterate You | |
*/ | |
message: string; | |
/** | |
* @qotd | |
*/ | |
quote: string; | |
} | |
type WithResponseSuccess<T> = { | |
status: 'ok'; | |
data: T; | |
}; | |
type WithResponseFailure = { | |
status: 'error'; | |
/** | |
* @example Bad Request | |
*/ | |
message: string; | |
}; | |
type WithResponse<T> = WithResponseSuccess<T> | WithResponseFailure; | |
export type GET = { | |
'/user': WithResponse<User>; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"scripts": { | |
"start": "ms -c ./config.ts" | |
}, | |
"devDependencies": { | |
"@manta-style/cli": "0.1.1", | |
"@manta-style/plugin-mock-faker": "0.1.0", | |
"@manta-style/plugin-mock-range": "0.1.0", | |
"@manta-style/plugin-mock-iterate": "0.1.0", | |
"@manta-style/plugin-mock-qotd": "0.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try
0.2.0-alpha.1