Skip to content

Commit eb5237a

Browse files
committed
Add fixture
1 parent 824a620 commit eb5237a

File tree

10 files changed

+2154
-10
lines changed

10 files changed

+2154
-10
lines changed

packages/cli-v3/e2e/compile.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { esbuildDecorators } from "@anatine/esbuild-decorators";
22
import { build } from "esbuild";
33
import { readFileSync } from "node:fs";
44
import { writeFile } from "node:fs/promises";
5-
import { basename, join, posix, resolve } from "node:path";
5+
import { basename, join, posix, relative, resolve, sep } from "node:path";
66
import invariant from "tiny-invariant";
77

88
import {
@@ -145,17 +145,22 @@ export async function compile(options: CompileOptions) {
145145
logger.debug(`Writing compiled files to ${tempDir}`);
146146

147147
// Get the metaOutput for the result build
148+
const pathsToProjectDir = relative(
149+
join(process.cwd(), "e2e", "fixtures"),
150+
config.projectDir
151+
).split(sep);
152+
148153
const metaOutput =
149154
result.metafile!.outputs[
150-
posix.join("e2e", "fixtures", basename(config.projectDir), "out", "stdin.js")
155+
posix.join("e2e", "fixtures", ...pathsToProjectDir, "out", "stdin.js")
151156
];
152157

153158
invariant(metaOutput, "Meta output for the result build is missing");
154159

155160
// Get the metaOutput for the entryPoint build
156161
const entryPointMetaOutput =
157162
entryPointResult.metafile!.outputs[
158-
posix.join("e2e", "fixtures", basename(config.projectDir), "out", "stdin.js")
163+
posix.join("e2e", "fixtures", ...pathsToProjectDir, "out", "stdin.js")
159164
];
160165

161166
invariant(entryPointMetaOutput, "Meta output for the entryPoint build is missing");

packages/cli-v3/e2e/fixtures.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export interface TestCase {
22
resolveEnv?: { [key: string]: string };
33
id: string;
4+
rootDir?: string;
45
skipTypecheck?: boolean;
56
wantConfigNotFoundError?: boolean;
67
wantConfigInvalidError?: boolean;
@@ -11,6 +12,13 @@ export interface TestCase {
1112
}
1213

1314
export const fixturesConfig: TestCase[] = [
15+
{
16+
id: "compile-monorepo-packages",
17+
skipTypecheck: true,
18+
rootDir: "packages/trigger",
19+
// TODO remove
20+
wantInstallationError: true,
21+
},
1422
{
1523
id: "config-infisical-sdk",
1624
skipTypecheck: true,

0 commit comments

Comments
 (0)