Skip to content

Commit d8cb0ee

Browse files
committed
Fix check not running in env
1 parent 2ed0480 commit d8cb0ee

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

packages/cli/src/check.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ import { Miniflare } from 'miniflare';
22

33
import { buildScriptFromManifest } from './build';
44
import { getMiniflareOptions } from './dev';
5-
import { withEnvironment } from './environments';
65

76
/**
87
* Check that an integration can build correctly without publishing it.
98
*/
109
export async function checkIntegrationBuild(manifestSpecPath: string) {
11-
// We use a special env "test" to make it easy to configure the integration for testing.
12-
return withEnvironment('test', async () => {
13-
const { path: scriptPath } = await buildScriptFromManifest(manifestSpecPath, {
14-
mode: 'development',
15-
});
10+
const { path: scriptPath } = await buildScriptFromManifest(manifestSpecPath, {
11+
mode: 'development',
12+
});
1613

17-
const mf = new Miniflare(getMiniflareOptions(scriptPath));
18-
await mf.ready;
14+
const mf = new Miniflare(getMiniflareOptions(scriptPath));
15+
await mf.ready;
1916

20-
await mf.dispose();
21-
});
17+
await mf.dispose();
2218
}

packages/cli/src/cli.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ program
145145
.argument('[file]', 'integration definition file', DEFAULT_MANIFEST_FILE)
146146
.description('check the integration build')
147147
.action(async (filePath) => {
148-
await checkIntegrationBuild(
149-
await resolveIntegrationManifestPath(path.resolve(process.cwd(), filePath)),
150-
);
148+
// We use a special env "test" to make it easy to configure the integration for testing.
149+
return withEnvironment('test', async () => {
150+
await checkIntegrationBuild(
151+
await resolveIntegrationManifestPath(path.resolve(process.cwd(), filePath)),
152+
);
153+
});
151154
});
152155

153156
const openAPIProgram = program.command('openapi').description('manage OpenAPI specifications');

0 commit comments

Comments
 (0)