You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: remove process.exit() from the pages code
This enables simpler testing, as we do not have to spawn new child processes
to avoid the `process.exit()` from killing the jest process.
As part of the refactor, some of the `Error` classes have been moved to a
shared `errors.ts` file.
it("should print a deprecation message for 'generate'",async()=>{
971
971
awaitrunWrangler("generate").catch((err)=>{
972
972
expect(err.message).toMatchInlineSnapshot(`
973
-
"DEPRECATION WARNING:
973
+
"DEPRECATION:
974
974
\`wrangler generate\` has been deprecated, please refer to https://github.com/cloudflare/wrangler2/blob/main/docs/deprecations.md#generate for alternatives"
975
975
`);
976
976
});
977
977
});
978
978
it("should print a deprecation message for 'build'",async()=>{
979
979
awaitrunWrangler("build").catch((err)=>{
980
980
expect(err.message).toMatchInlineSnapshot(`
981
-
"DEPRECATION WARNING:
981
+
"DEPRECATION:
982
982
\`wrangler build\` has been deprecated, please refer to https://github.com/cloudflare/wrangler2/blob/main/docs/deprecations.md#build for alternatives"
@@ -46,36 +30,28 @@ describe("subcommand implicit help ran on imcomplete command execution", () => {
46
30
🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose"
47
31
`);
48
32
});
49
-
});
50
33
51
-
describe("beta message for subcommands",()=>{
52
-
constbetaMsg=
53
-
"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose";
`"Must specify a directory of static assets to serve or a command to run."`
40
+
);
41
+
42
+
expect(std.out).toMatchInlineSnapshot(
43
+
`"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose"`
44
+
);
45
+
});
46
+
47
+
// Note that `wrangler pages functions` does nothing...
67
48
68
-
it("should display for pages:functions",async()=>{
`"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose"`
@@ -25,17 +26,20 @@ import type { BuilderCallback } from "yargs";
25
26
exportconstpagesBetaWarning=
26
27
"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose";
0 commit comments