Skip to content

Commit

Permalink
Remove some remaining traces of mondomob and gae-js
Browse files Browse the repository at this point in the history
  • Loading branch information
mbyrne00 committed Dec 8, 2023
1 parent 51bd5d6 commit 1086a97
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 265 deletions.
236 changes: 0 additions & 236 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions packages/gcp-core/src/configuration/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Config = z.infer<typeof configSchema>;
const validator = zodValidator(configSchema);

const withOptions = (overrides?: Partial<ConfigurationOptions<Config>>): ConfigurationOptions<Config> => ({
projectId: "gae-js-jest",
projectId: "gcp-core-test",
validator,
...overrides,
});
Expand All @@ -43,8 +43,8 @@ describe("configuration", () => {
const config = await initialiseConfiguration(withOptions());

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "config environment file string",
});
});
Expand All @@ -53,8 +53,8 @@ describe("configuration", () => {
const config = await initialiseConfiguration(fromDir("with-environment"));

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "with-environment environment file string",
});
});
Expand All @@ -63,8 +63,8 @@ describe("configuration", () => {
const config = await initialiseConfiguration(fromDir("no-environment"));

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "default string",
});
});
Expand All @@ -73,8 +73,8 @@ describe("configuration", () => {
const config = await initialiseConfiguration(fromDir("no-default"));

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "no-default environment file string",
});
});
Expand All @@ -85,8 +85,8 @@ describe("configuration", () => {
);

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "options string",
});
});
Expand All @@ -106,7 +106,7 @@ describe("configuration", () => {
});

it(
"resolves projectId from gae-js environment variable",
"resolves projectId from gcp-core environment variable",
withEnvVars({ [ENV_VAR_PROJECT]: "proj-envvar" }, async () => {
const config = await initialiseConfiguration(withOptions({ projectId: undefined }));

Expand Down Expand Up @@ -153,7 +153,7 @@ describe("configuration", () => {
})
);

expect(config.environment).toBe("gae-js");
expect(config.environment).toBe("gcp-co");
});
});

Expand All @@ -174,12 +174,12 @@ describe("configuration", () => {
const config = await initialiseConfiguration(withOptions());

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "top secret value",
});
expect(accessSecretVersionSpy).toHaveBeenCalledWith({
name: "projects/gae-js-jest/secrets/MY_SECRET/versions/latest",
name: "projects/gcp-core-test/secrets/MY_SECRET/versions/latest",
});
}
)
Expand All @@ -196,8 +196,8 @@ describe("configuration", () => {
it("returns config when validator passes", async () => {
const config = await initialiseConfiguration(withOptions({ validator: alwaysPasses }));
expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "config environment file string",
});
});
Expand All @@ -224,8 +224,8 @@ describe("configuration", () => {
);

expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "long top secret value",
});
});
Expand All @@ -236,13 +236,13 @@ describe("configuration", () => {
customString: "env var string",
});
const config = await initialiseConfiguration({
projectId: "gae-js-jest",
projectId: "gcp-core-test",
validator,
configDir: `${__dirname}/__test/with-environment`,
});
expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "env var string",
});
});
Expand All @@ -252,16 +252,16 @@ describe("configuration", () => {
customString: "env var string",
});
const config = await initialiseConfiguration({
projectId: "gae-js-jest",
projectId: "gcp-core-test",
validator,
configDir: `${__dirname}/__test/with-environment`,
overrides: {
customString: "options string",
},
});
expect(config).toEqual({
projectId: "gae-js-jest",
environment: "jest",
projectId: "gcp-core-test",
environment: "test",
customString: "options string",
});
});
Expand Down
Loading

0 comments on commit 1086a97

Please sign in to comment.