Skip to content

Commit 7e11fd4

Browse files
Feature: test generator cli (#24)
1 parent be8046f commit 7e11fd4

File tree

24 files changed

+361
-743
lines changed

24 files changed

+361
-743
lines changed

common/config/rush/npm-shrinkwrap.json

Lines changed: 335 additions & 415 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ts-docs-gen/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test-watch": "start npm run build-tests -- --watchAll && jest --watchAll",
1111
"tslint": "tslint --project . --config ./tslint.json && echo Successfully passed tslint test.",
1212
"build": "tsc -p .",
13-
"build-tests": "node ../../tools/test-generator-cli/dist/index.js"
13+
"build-tests": "test-generator-cli"
1414
},
1515
"engine": "node >= 7.5.0",
1616
"author": "simplrjs <[email protected]> (https://github.com/simplrjs)",
@@ -24,6 +24,7 @@
2424
"typescript": "^2.6.2"
2525
},
2626
"devDependencies": {
27+
"@simplrjs/test-generator-cli": "^0.1.2",
2728
"@types/jest": "^22.0.0",
2829
"@types/sinon": "^4.1.2",
2930
"jest": "^22.0.4",

packages/ts-docs-gen/tests/cases/__tests__/__snapshots__/simple-project-1.test.ts.snap

Lines changed: 14 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ts-docs-gen/tests/cases/simple-project-1/index.ts renamed to packages/ts-docs-gen/tests/cases/simple-project-1/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type SimpleTypeParameters = keyof SimpleType;
55

66
export type GenericType<T> = { Property: T; };
77

8+
// TODO: fix GeneratorHelpers.ApiTypeToString to generate correct type in code block.
89
/**
910
* General comment about UnionType type.
1011
*/
@@ -27,6 +28,7 @@ export type Numbers = 1 | 2 | 3 | 4 | 5 | 6;
2728

2829
export type Name = string;
2930

31+
// TODO: fix wrong type resolved.
3032
export type NameResolver = () => string;
3133

3234
export type NameOrResolver = Name | NameResolver;
@@ -37,6 +39,7 @@ export type Tree<T> = {
3739
right: Tree<T>;
3840
};
3941

42+
// TODO: add link to type from type literal (LinkedList in this case).
4043
export type LinkedList<T> = T & { next: LinkedList<T> };
4144

4245
export type Negative = void | never;
@@ -45,6 +48,7 @@ export type IndexType = { [key: string]: number; };
4548

4649
export type SelectedNumbers = Readonly<Numbers>;
4750

51+
// TODO: fix wrong symbols escaped.
4852
export type PartialSimpleType = Partial<SimpleType>;
4953

5054
export type Proxy<T> = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"EntryFiles": [
3-
"./index.ts"
3+
"./src/index.ts"
44
]
55
}

packages/ts-docs-gen/tests/cases/simple-project-1/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"lib": [
1616
"es6"
1717
],
18-
"types": [
19-
"node"
20-
],
2118
"typeRoots": [
2219
"./node_modules/@types"
2320
]

packages/ts-docs-gen/tests/cases/simple-project-2/foo.ts renamed to packages/ts-docs-gen/tests/cases/simple-project-2/src/foo.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ export class Foo {
5656
}
5757

5858
// TODO: fix falsy escaped characters in complex types links.
59-
public PrintMessage<T extends Object>(messageDto: MessageDto<T>): void {
60-
console.info(messageDto);
61-
}
59+
// tslint:disable-next-line:no-empty
60+
public PrintMessage<T extends Object>(messageDto: MessageDto<T>): void { }
6261

6362
public ResolveSimpleMessageObject<T>(message: T): { Message: T } {
6463
return {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"EntryFiles": [
3-
"./index.ts",
4-
"./foo.ts",
5-
"./boo.ts"
3+
"./src/index.ts",
4+
"./src/foo.ts",
5+
"./src/boo.ts"
66
]
77
}

0 commit comments

Comments
 (0)