Skip to content

Commit 9d6ee74

Browse files
committed
remove usage of libraries to fix e2e
1 parent 5a1ce3c commit 9d6ee74

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/@apphosting/adapter-nextjs/e2e/run-local.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import { fileURLToPath } from "url";
55
import { parse as parseYaml } from "yaml";
66
import { spawn } from "child_process";
77
import fsExtra from "fs-extra";
8-
import { glob } from "glob";
98

10-
const { readFileSync, mkdirp, rm } = fsExtra;
9+
const { readFileSync, mkdirp, rmdir } = fsExtra;
1110

1211
const __dirname = dirname(fileURLToPath(import.meta.url));
1312

@@ -58,10 +57,10 @@ const scenarios: Scenario[] = [
5857
name: scenario.name,
5958
setup: async (cwd: string) => {
6059
const configContent = scenario.config;
61-
62-
// Remove any existing next.config.* files
63-
// eslint-disable-next-line @typescript-eslint/await-thenable
64-
const configFiles = await glob(join(cwd, "next.config.*"));
60+
const files = await fsExtra.readdir(cwd);
61+
const configFiles = files.filter(file => file.startsWith('next.config.'))
62+
.map(file => join(cwd, file));
63+
6564
for (const file of configFiles) {
6665
await fsExtra.remove(file);
6766
console.log(`Removed existing config file: ${file}`);
@@ -77,7 +76,7 @@ const scenarios: Scenario[] = [
7776

7877
const errors: any[] = [];
7978

80-
await rm(join(__dirname, "runs"), { recursive: true }).catch(() => undefined);
79+
await rmdir(join(__dirname, "runs"), { recursive: true }).catch(() => undefined);
8180

8281
// Run each scenario
8382
for (const scenario of scenarios) {

packages/@apphosting/adapter-nextjs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"build": "rm -rf dist && tsc && chmod +x ./dist/bin/*",
2525
"test": "npm run test:unit && npm run test:functional",
2626
"test:unit": "ts-mocha -p tsconfig.json 'src/**/*.spec.ts' 'src/*.spec.ts'",
27-
"test:functional": "NODE_DEBUG=* node --loader ts-node/esm --trace-warnings --unhandled-rejections=strict ./e2e/run-local.ts",
27+
"test:functional": "node --loader ts-node/esm ./e2e/run-local.ts",
2828
"localregistry:start": "npx verdaccio --config ../publish-dev/verdaccio-config.yaml",
2929
"localregistry:publish": "(npm view --registry=http://localhost:4873 @apphosting/adapter-nextjs && npm unpublish --@apphosting:registry=http://localhost:4873 --force); npm publish --@apphosting:registry=http://localhost:4873"
3030
},
@@ -56,7 +56,6 @@
5656
}
5757
},
5858
"devDependencies": {
59-
"glob": "^11.0.1",
6059
"@types/fs-extra": "*",
6160
"@types/mocha": "*",
6261
"@types/tmp": "*",

0 commit comments

Comments
 (0)