Skip to content

Commit 8e4d417

Browse files
authored
Clean up some test projects. (#5124)
* Make the ts-command-line-test project a unit test. * Clean up api-documenter-scenarios. * Extract scenarios test helpers. * Remove extraneous copyrights. * Enable eslint for api-documenter-test. * Add verbose logging around finding the lint config file. * Clean up the API Extractor tests. * fixup! Make the ts-command-line-test project a unit test. * Update repo README. * fixup! Clean up api-documenter-scenarios. * Clean up build for localization-plugin-test-* projects.
1 parent 438525c commit 8e4d417

File tree

160 files changed

+1573
-2009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1573
-2009
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ These GitHub repositories provide supplementary resources for Rush Stack:
186186
| [/build-tests/package-extractor-test-02](./build-tests/package-extractor-test-02/) | This project is used by tests in the @rushstack/package-extractor package. |
187187
| [/build-tests/package-extractor-test-03](./build-tests/package-extractor-test-03/) | This project is used by tests in the @rushstack/package-extractor package. |
188188
| [/build-tests/package-extractor-test-04](./build-tests/package-extractor-test-04/) | This project is used by tests in the @rushstack/package-extractor package. |
189+
| [/build-tests/run-scenarios-helpers](./build-tests/run-scenarios-helpers/) | Helpers for the *-scenarios test projects. |
189190
| [/build-tests/rush-amazon-s3-build-cache-plugin-integration-test](./build-tests/rush-amazon-s3-build-cache-plugin-integration-test/) | Tests connecting to an amazon S3 endpoint |
190191
| [/build-tests/rush-lib-declaration-paths-test](./build-tests/rush-lib-declaration-paths-test/) | This project ensures all of the paths in rush-lib/lib/... have imports that resolve correctly. If this project builds, all `lib/**/*.d.ts` files in the `@microsoft/rush-lib` package are valid. |
191192
| [/build-tests/rush-project-change-analyzer-test](./build-tests/rush-project-change-analyzer-test/) | This is an example project that uses rush-lib's ProjectChangeAnalyzer to |
192193
| [/build-tests/rush-redis-cobuild-plugin-integration-test](./build-tests/rush-redis-cobuild-plugin-integration-test/) | Tests connecting to an redis server |
193194
| [/build-tests/set-webpack-public-path-plugin-test](./build-tests/set-webpack-public-path-plugin-test/) | Building this project tests the set-webpack-public-path-plugin |
194-
| [/build-tests/ts-command-line-test](./build-tests/ts-command-line-test/) | Building this project is a regression test for ts-command-line |
195195
| [/eslint/local-eslint-config](./eslint/local-eslint-config/) | An ESLint configuration consumed projects inside the rushstack repo. |
196196
| [/libraries/rush-themed-ui](./libraries/rush-themed-ui/) | Rush Component Library: a set of themed components for rush projects |
197197
| [/libraries/rushell](./libraries/rushell/) | Execute shell commands using a consistent syntax on every platform |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
3+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4+
require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
5+
6+
module.exports = {
7+
extends: [
8+
'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
9+
'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
10+
],
11+
parserOptions: { tsconfigRootDir: __dirname }
12+
};

build-tests/api-documenter-scenarios/build.js

-27
This file was deleted.

build-tests/api-documenter-scenarios/config/build-config.json

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",
3+
4+
"extends": "local-node-rig/profiles/default/config/heft.json",
5+
6+
"phasesByName": {
7+
"build": {
8+
"tasksByName": {
9+
"copy-dts": {
10+
"taskPlugin": {
11+
"pluginPackage": "@rushstack/heft",
12+
"pluginName": "copy-files-plugin",
13+
"options": {
14+
"copyOperations": [
15+
{
16+
"sourcePath": "src",
17+
"destinationFolders": ["lib"],
18+
"includeGlobs": ["**/*.d.ts"]
19+
}
20+
]
21+
}
22+
}
23+
},
24+
25+
"run-scenarios": {
26+
"taskDependencies": ["typescript"],
27+
"taskPlugin": {
28+
"pluginPackage": "@rushstack/heft",
29+
"pluginName": "run-script-plugin",
30+
"options": {
31+
"scriptPath": "./lib/runScenarios.js"
32+
}
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// The "rig.json" file directs tools to look for their config files in an external package.
3+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
4+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5+
6+
"rigPackageName": "local-node-rig"
7+
}

build-tests/api-documenter-scenarios/config/rush-project.json

-10
This file was deleted.

build-tests/api-documenter-scenarios/package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
"private": true,
66
"typings": "dist/internal/some-fake-file.d.ts",
77
"scripts": {
8-
"build": "node build.js",
9-
"_phase:build": "node build.js"
8+
"build": "heft build --clean",
9+
"_phase:build": "heft build --clean"
1010
},
1111
"devDependencies": {
1212
"@microsoft/api-documenter": "workspace:*",
1313
"@microsoft/api-extractor": "workspace:*",
14-
"@microsoft/teams-js": "1.3.0-beta.4",
14+
"@rushstack/heft": "workspace:*",
1515
"@rushstack/node-core-library": "workspace:*",
16-
"@types/jest": "29.2.5",
17-
"@types/node": "18.17.15",
18-
"fs-extra": "~11.3.0",
19-
"typescript": "~5.4.2"
16+
"local-node-rig": "workspace:*",
17+
"run-scenarios-helpers": "workspace:*"
2018
}
2119
}

build-tests/api-documenter-scenarios/src/inheritedMembers/index.ts

+19
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
13
import { Extractor } from '@microsoft/api-extractor';
24

35
/** @public */
6+
// eslint-disable-next-line @typescript-eslint/no-namespace
47
export namespace Namespace1 {
58
/** @public */
69
export class Class3 {
710
/** Some prop. */
11+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
812
someProp: number;
913

1014
/** Some method. */
15+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
1116
someMethod(x: boolean | string): void {}
1217

1318
/** Some overload. */
19+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
1420
someOverload(x: boolean): void;
1521

1622
/** Some overload. */
23+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
1724
someOverload(x: string): void;
1825

26+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
1927
someOverload(x: boolean | string): void {}
2028
}
2129
}
2230

2331
/** @public */
2432
export class Class2<T> extends Namespace1.Class3 {
2533
/** A second prop. */
34+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
2635
secondProp: boolean | string;
2736

2837
/** A third prop. */
38+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
2939
thirdProp: T;
3040

3141
/** Some method. Overrides `Class3.someMethod`. */
42+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
3243
someMethod(x: boolean): void {}
3344
}
3445

3546
/** @public */
3647
export class Class1 extends Class2<number> {
3748
/** A second prop. Overrides `Class2.secondProp`. */
49+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
3850
secondProp: boolean;
3951

4052
/** A fourth prop */
53+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
4154
fourthProp: number;
4255

4356
/** Some overload. Overrides `Class3.someOverload`. */
57+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
4458
someOverload(x: boolean | string): void {}
4559
}
4660

@@ -72,6 +86,7 @@ export interface IExtendsMultipleInterfaces extends IInterface1, IInterface2 {
7286
}
7387

7488
class UnexportedClass {
89+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
7590
someProp: number;
7691
}
7792

@@ -86,14 +101,17 @@ export class ExtendsUnexportedClass extends UnexportedClass {}
86101
* @public
87102
*/
88103
export class ExtendsAnonymousClass extends class {
104+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
89105
someProp: number;
90106
} {}
91107

92108
/**
93109
* Some class-like variable.
94110
* @public
95111
*/
112+
// eslint-disable-next-line @typescript-eslint/typedef
96113
export const ClassLikeVariable = class {
114+
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
97115
someProp: number;
98116
};
99117

@@ -107,6 +125,7 @@ export class ExtendsClassLikeVariable extends ClassLikeVariable {}
107125
* Some interface-like type alias.
108126
* @public
109127
*/
128+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
110129
export type IInterfaceLikeTypeAlias = {
111130
someProp: number;
112131
};

0 commit comments

Comments
 (0)