Skip to content

Commit f0e391d

Browse files
codenemericallam
authored andcommitted
Add missing peer dep resolving fixture
1 parent f04613c commit f0e391d

File tree

13 files changed

+4966
-68
lines changed

13 files changed

+4966
-68
lines changed

packages/cli-v3/e2e/README.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -147,31 +147,16 @@ This will test your fixture project, and generate outputs in the `packages/cli-v
147147

148148
9. Commit your changes.
149149

150-
10. Add your fixture test configuration in `testCases.json`.
150+
10. Add your fixture test configuration in `fixtures.config.js`.
151151

152-
```json testCases.json
153-
[
154-
...
152+
```javascript fixtures.config.js
153+
export const fixturesConfig = [
154+
// ...
155155
{
156-
"name": "<fixture-name>",
156+
id: "<fixture-name>",
157157
},
158-
...
159-
]
158+
// ...
159+
];
160160
```
161161

162-
You can configure your test case by adding other properties to the JSON object. Here is the `TestCase` type for reference:
163-
164-
```typescript
165-
type TestCase = {
166-
name: string;
167-
skipTypecheck?: boolean;
168-
wantConfigNotFoundError?: boolean;
169-
wantBadConfigError?: boolean;
170-
wantCompilationError?: boolean;
171-
wantWorkerError?: boolean;
172-
wantDependenciesError?: boolean;
173-
wantInstallationError?: boolean;
174-
};
175-
```
176-
177-
> You might expect a specific error at a specific test, so use those configuration option at your discretion.
162+
> You might expect a specific error for a specific test, so use those configuration option at your discretion.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
export interface TestCase {
2+
resolveEnv?: { [key: string]: string };
3+
id: string;
4+
skipTypecheck?: boolean;
5+
wantConfigNotFoundError?: boolean;
6+
wantConfigInvalidError?: boolean;
7+
wantCompilationError?: boolean;
8+
wantWorkerError?: boolean;
9+
wantDependenciesError?: boolean;
10+
wantInstallationError?: boolean;
11+
}
12+
13+
export const fixturesConfig: TestCase[] = [
14+
{
15+
id: "config-invalid",
16+
wantConfigInvalidError: true,
17+
},
18+
{
19+
id: "config-not-found",
20+
wantConfigNotFoundError: true,
21+
},
22+
{
23+
id: "dep-to-add-scope-parsing",
24+
skipTypecheck: true,
25+
},
26+
{
27+
id: "infisical-sdk",
28+
skipTypecheck: true,
29+
// Should not fail
30+
wantCompilationError: true,
31+
},
32+
{
33+
id: "lock-nested-peer-deps",
34+
skipTypecheck: true,
35+
resolveEnv: {
36+
npm_config_legacy_peer_deps: "true",
37+
},
38+
},
39+
{
40+
id: "resolve-legacy-peer-deps",
41+
skipTypecheck: true,
42+
// Should fail with better error at resolve
43+
wantWorkerError: true,
44+
},
45+
{
46+
id: "resolve-trigger-deps",
47+
skipTypecheck: true,
48+
},
49+
{
50+
id: "server-only",
51+
skipTypecheck: true,
52+
},
53+
{
54+
id: "trigger-dir-missing",
55+
skipTypecheck: true,
56+
},
57+
{
58+
id: "trigger-dir-not-found",
59+
skipTypecheck: true,
60+
},
61+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

0 commit comments

Comments
 (0)