wip
This commit is contained in:
@@ -9,12 +9,12 @@ describe('getAppMode', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
process.env = { ...originalEnv };
|
||||
process.env.NODE_ENV = 'production';
|
||||
(process.env as any).NODE_ENV = 'production';
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
process.env.NODE_ENV = ORIGINAL_NODE_ENV;
|
||||
(process.env as any).NODE_ENV = ORIGINAL_NODE_ENV;
|
||||
});
|
||||
|
||||
it('returns "pre-launch" when NEXT_PUBLIC_GRIDPILOT_MODE is undefined', () => {
|
||||
@@ -55,7 +55,7 @@ describe('getAppMode', () => {
|
||||
});
|
||||
|
||||
it('throws in development when NEXT_PUBLIC_GRIDPILOT_MODE is invalid', () => {
|
||||
process.env.NODE_ENV = 'development';
|
||||
(process.env as any).NODE_ENV = 'development';
|
||||
process.env.NEXT_PUBLIC_GRIDPILOT_MODE = 'invalid-mode';
|
||||
|
||||
expect(() => getAppMode()).toThrowError(/Invalid NEXT_PUBLIC_GRIDPILOT_MODE/);
|
||||
|
||||
@@ -77,7 +77,7 @@ describe('/api/signup POST', () => {
|
||||
|
||||
const data = (await response.json()) as { error: unknown };
|
||||
expect(typeof data.error).toBe('string');
|
||||
expect(data.error.toLowerCase()).toContain('email');
|
||||
expect(typeof data.error === 'string' && data.error.toLowerCase()).toContain('email');
|
||||
});
|
||||
|
||||
it('rejects disposable email domains with 400 and error message', async () => {
|
||||
@@ -110,7 +110,7 @@ describe('/api/signup POST', () => {
|
||||
|
||||
const data = (await second.json()) as { error: unknown };
|
||||
expect(typeof data.error).toBe('string');
|
||||
expect(data.error.toLowerCase()).toContain('already');
|
||||
expect(typeof data.error === 'string' && data.error.toLowerCase()).toContain('already');
|
||||
});
|
||||
|
||||
it('returns 429 with retryAfter when rate limit is exceeded', async () => {
|
||||
|
||||
Reference in New Issue
Block a user