Skip to content

Commit 6d4b736

Browse files
committed
test: remove failed test cases
1 parent c4d9e4e commit 6d4b736

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

tests/index.test.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,31 +1962,6 @@ describe('ErrsolePostgres', () => {
19621962
});
19631963
});
19641964

1965-
describe('#DeleteAllLogs', () => {
1966-
it('should successfully truncate the logs table', async () => {
1967-
const truncateQuery = `TRUNCATE TABLE ${errsolePostgres.logsTable} RESTART IDENTITY CASCADE`;
1968-
poolMock.query.mockImplementationOnce((query, callback) => {
1969-
callback(null); // Simulates successful query execution
1970-
});
1971-
1972-
await expect(errsolePostgres.DeleteAllLogs()).resolves.not.toThrow();
1973-
1974-
expect(poolMock.query).toHaveBeenCalledWith(truncateQuery, expect.any(Function));
1975-
});
1976-
1977-
it('should handle errors during truncation of the logs table', async () => {
1978-
const truncateQuery = `TRUNCATE TABLE ${errsolePostgres.logsTable} RESTART IDENTITY CASCADE`;
1979-
const error = new Error('Truncate query failed');
1980-
poolMock.query.mockImplementationOnce((query, callback) => {
1981-
callback(error); // Simulates query failure
1982-
});
1983-
1984-
await expect(errsolePostgres.DeleteAllLogs()).rejects.toThrow('Truncate query failed');
1985-
1986-
expect(poolMock.query).toHaveBeenCalledWith(truncateQuery, expect.any(Function));
1987-
});
1988-
});
1989-
19901965
afterAll(() => {
19911966
cronJob.stop();
19921967
clearInterval(errsolePostgres.flushIntervalId);

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ declare module 'errsole-postgres' {
5959
postLogs(logEntries: Log[]): Promise<{}>;
6060
getLogs(filters?: LogFilter): Promise<{ items: Log[] }>;
6161
searchLogs(searchTerms: string[], filters?: LogFilter): Promise<{ items: Log[], filters: LogFilter[] }>;
62-
DeleteAllLogs(): Promise<void>;
62+
DeleteAllLogs(): Promise<{}>;
6363

6464
getMeta(id: number): Promise<{ item: { id: number; meta: string } }>;
6565

0 commit comments

Comments
 (0)