Skip to content

Commit 4585bf7

Browse files
committed
lint
1 parent dda4ccb commit 4585bf7

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

packages/@apphosting/common/src/index.spec.ts

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import path from "path";
44
import os from "os";
55
import { getBuildOptions, updateOrCreateGitignore } from "./index";
66

7-
const originalCwd = process.cwd;
7+
const originalCwd = process.cwd.bind(process);
88

99
describe("get a set of default build options", () => {
10-
const mockCwd = '/fake/project/';
10+
const mockCwd = "/fake/project/";
1111
beforeEach(() => {
1212
process.cwd = () => mockCwd;
13-
})
13+
});
1414

1515
afterEach(() => {
1616
process.cwd = originalCwd;
@@ -20,33 +20,40 @@ describe("get a set of default build options", () => {
2020
delete process.env.MONOREPO_PROJECT;
2121
});
2222

23-
it('returns monorepo build options when MONOREPO_COMMAND is set', () => {
24-
process.env.MONOREPO_COMMAND = 'turbo';
25-
process.env.MONOREPO_BUILD_ARGS = '--filter=web,--env-mode=strict';
26-
process.env.GOOGLE_BUILDABLE = '/workspace/apps/web';
27-
process.env.MONOREPO_PROJECT = 'web';
23+
it("returns monorepo build options when MONOREPO_COMMAND is set", () => {
24+
process.env.MONOREPO_COMMAND = "turbo";
25+
process.env.MONOREPO_BUILD_ARGS = "--filter=web,--env-mode=strict";
26+
process.env.GOOGLE_BUILDABLE = "/workspace/apps/web";
27+
process.env.MONOREPO_PROJECT = "web";
2828

2929
// Assert that the returned options are correct
3030
const expectedOptions = {
31-
buildCommand: 'turbo',
32-
buildArgs: ['run', 'build', '--filter=web', '--env-mode=strict'],
33-
projectDirectory: '/workspace/apps/web',
34-
projectName: 'web',
31+
buildCommand: "turbo",
32+
buildArgs: ["run", "build", "--filter=web", "--env-mode=strict"],
33+
projectDirectory: "/workspace/apps/web",
34+
projectName: "web",
3535
};
36-
assert.deepStrictEqual(getBuildOptions(), expectedOptions, 'Monorepo build options are incorrect');
36+
assert.deepStrictEqual(
37+
getBuildOptions(),
38+
expectedOptions,
39+
"Monorepo build options are incorrect",
40+
);
3741
});
3842

39-
it('returns standard build options when MONOREPO_COMMAND is not set', () => {
43+
it("returns standard build options when MONOREPO_COMMAND is not set", () => {
4044
const expectedOptions = {
41-
buildCommand: 'npm',
42-
buildArgs: ['run', 'build'],
45+
buildCommand: "npm",
46+
buildArgs: ["run", "build"],
4347
projectDirectory: process.cwd(),
4448
};
45-
assert.deepStrictEqual(getBuildOptions(), expectedOptions, 'Standard build options are incorrect');
49+
assert.deepStrictEqual(
50+
getBuildOptions(),
51+
expectedOptions,
52+
"Standard build options are incorrect",
53+
);
4654
});
4755
});
4856

49-
5057
describe("update or create .gitignore", () => {
5158
let tmpDir: string;
5259
beforeEach(() => {

0 commit comments

Comments
 (0)