ci: add pull request quality gates
CI / install-and-build (pull_request) Successful in 1m29s
CI / format (pull_request) Successful in 51s
CI / typecheck-source (pull_request) Successful in 41s
CI / typecheck-tests (pull_request) Successful in 39s
CI / test (pull_request) Successful in 51s
CI / lint (pull_request) Successful in 21s
CI / install-and-build (pull_request) Successful in 1m29s
CI / format (pull_request) Successful in 51s
CI / typecheck-source (pull_request) Successful in 41s
CI / typecheck-tests (pull_request) Successful in 39s
CI / test (pull_request) Successful in 51s
CI / lint (pull_request) Successful in 21s
Co-Authored-By: gpt-5.6-terra <noreply@openai.com>
This commit was merged in pull request #12.
This commit is contained in:
+17
-9
@@ -11,7 +11,7 @@ import { hashPassword } from "../../src/util/hash.js";
|
||||
export function runUserTests(
|
||||
name: string,
|
||||
getDb: () => Promise<{ db: DbInterface; close(): void }>,
|
||||
getReadonlyDb?: () => Promise<{ db: DbInterface; close(): void }>
|
||||
getReadonlyDb?: () => Promise<{ db: DbInterface; close(): void }>,
|
||||
): void {
|
||||
describe(`${name}: users`, async () => {
|
||||
let db: DbInterface;
|
||||
@@ -57,13 +57,18 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof NotFoundAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("getUserByEmail returns the created user", async () => {
|
||||
const email = `user-byemail-${Date.now()}@test.example`;
|
||||
await db.createUser({ email, name: "ByEmail User", password: hashedPw, flags: {} });
|
||||
await db.createUser({
|
||||
email,
|
||||
name: "ByEmail User",
|
||||
password: hashedPw,
|
||||
flags: {},
|
||||
});
|
||||
const found = await db.getUserByEmail(email);
|
||||
assert.ok("email" in found, "result includes email");
|
||||
assert.equal(found.email, email);
|
||||
@@ -75,7 +80,7 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof NotFoundAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -100,7 +105,10 @@ export function runUserTests(
|
||||
password: hashedPw,
|
||||
flags: {},
|
||||
});
|
||||
const updated = await db.updateUser({ uid: created.uid, name: "After Update" });
|
||||
const updated = await db.updateUser({
|
||||
uid: created.uid,
|
||||
name: "After Update",
|
||||
});
|
||||
assert.equal(updated.uid, created.uid);
|
||||
assert.equal(updated.name, "After Update");
|
||||
});
|
||||
@@ -117,7 +125,7 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof InvalidAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -134,7 +142,7 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof NotFoundAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -144,7 +152,7 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof NotFoundAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -178,7 +186,7 @@ export function runUserTests(
|
||||
(err) => {
|
||||
assert.ok(err instanceof ReadonlyAbodeError);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user