Skip to content

Commit

Permalink
revert unused changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raosan committed Jan 17, 2025
1 parent 2408144 commit 8685067
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 156 deletions.
12 changes: 6 additions & 6 deletions src/components/config/__tests__/parse-postman.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const unsupportedCollection = fs.readFileSync(
)

describe('parseConfigFromPostman', () => {
xit('throws invalid JSON format', () => {
it('throws invalid JSON format', () => {
try {
parseConfigFromPostman('../fetch.ts')
} catch (error: unknown) {
Expand All @@ -59,7 +59,7 @@ describe('parseConfigFromPostman', () => {
}
})

xit('throws unsupported collection version', () => {
it('throws unsupported collection version', () => {
try {
const collectionStr = unsupportedCollection

Expand All @@ -74,7 +74,7 @@ describe('parseConfigFromPostman', () => {
})

describe('basic Postman collection', () => {
xit('[v2.0] - should converted to Monika config', () => {
it('[v2.0] - should converted to Monika config', () => {
const collectionStr = basicCollectionV20
const collectionJson = JSON.parse(collectionStr)
const config: Config = parseConfigFromPostman(collectionStr)
Expand Down Expand Up @@ -123,7 +123,7 @@ describe('parseConfigFromPostman', () => {
}
})

xit('[v2.1] - should converted to Monika config', () => {
it('[v2.1] - should converted to Monika config', () => {
const collectionStr = basicCollectionV21
const collectionJson = JSON.parse(collectionStr)
const config: Config = parseConfigFromPostman(collectionStr)
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('parseConfigFromPostman', () => {
})

describe('grouped Postman collection', () => {
xit('[v2.0] - should converted to Monika config', () => {
it('[v2.0] - should converted to Monika config', () => {
const collectionStr = groupedCollectionV20
const collectionJson = JSON.parse(collectionStr)
const config: Config = parseConfigFromPostman(collectionStr)
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('parseConfigFromPostman', () => {
}
})

xit('[v2.1] - should converted to Monika config', () => {
it('[v2.1] - should converted to Monika config', () => {
const collectionStr = groupedCollectionV21
const collectionJson = JSON.parse(collectionStr)
const config: Config = parseConfigFromPostman(collectionStr)
Expand Down
116 changes: 0 additions & 116 deletions src/components/config/parse.ts

This file was deleted.

16 changes: 8 additions & 8 deletions src/components/config/probe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const probe: Probe = {
alerts: [],
id: 'xVUcW',
interval: 10,
name: 'Sample probe.js',
name: 'Sample Probe',
}

describe('Probe cache', () => {
Expand All @@ -48,18 +48,18 @@ describe('Probe cache', () => {
deleteProbe(id)
}
})
it('should add a probe.js', () => {
it('should add a probe', () => {
// act
addProbe(probe)

// assert
expect(findProbe(probe.id)).eq(probe)
})

it('should update a probe.js', () => {
it('should update a probe', () => {
// arrange
addProbe(probe)
const updatedName = 'Updated probe.js'
const updatedName = 'Updated probe'

// act
const isUpdated = updateProbe(probe.id, { ...probe, name: updatedName })
Expand All @@ -69,9 +69,9 @@ describe('Probe cache', () => {
expect(findProbe(probe.id)?.name).eq(updatedName)
})

it('should not update a nonexistent probe.js', () => {
it('should not update a nonexistent probe', () => {
// arrange
const updatedName = 'Updated probe.js'
const updatedName = 'Updated probe'

// act
const isUpdated = updateProbe('9WpFB', { ...probe, name: updatedName })
Expand All @@ -92,7 +92,7 @@ describe('Probe cache', () => {
expect(probes.length).eq(1)
})

it('should not remove a nonexistent probe.js', () => {
it('should not remove a nonexistent probe', () => {
// arrange
addProbe(probe)

Expand All @@ -104,7 +104,7 @@ describe('Probe cache', () => {
expect(getProbes().length).eq(1)
})

it('should remove a probe.js', () => {
it('should remove a probe', () => {
// arrange
addProbe(probe)

Expand Down
1 change: 0 additions & 1 deletion src/components/logger/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ export async function deleteNotificationLogs(
* @returns Promise<void>
*/
export async function flushAllLogs(): Promise<void> {
console.log('mashook: lala lala lala')
const dropAtlassianStatusPageTableSQL =
'DROP TABLE IF EXISTS atlassian_status_page_incidents;'
const dropInstatusPageTableSQL =
Expand Down
8 changes: 4 additions & 4 deletions src/symon/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ describe('Symon initiate', () => {
})
}).timeout(15_000)

it('should add a new probe.js', async () => {
it('should add a new probe', async () => {
// arrange
const newProbe: Probe = {
id: '3',
name: 'New probe.js',
name: 'New Probe',
interval: 2,
requests: [
{
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('Symon initiate', () => {
await symon.stop()
}).timeout(15_000)

it('should update a probe.js', async () => {
it('should update a probe', async () => {
// arrange
server.use(
http.get('http://localhost:4000/api/v1/monika/1234/probe-changes', () =>
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('Symon initiate', () => {
await symon.stop()
}).timeout(15_000)

it('should delete a probe.js', async () => {
it('should delete a probe', async () => {
// arrange
server.use(
http.get('http://localhost:4000/api/v1/monika/1234/probe-changes', () =>
Expand Down
18 changes: 0 additions & 18 deletions src/utils/read-file.ts

This file was deleted.

3 changes: 0 additions & 3 deletions test/plugins/prometheus/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ describe('Prometheus plugin', () => {
} catch (error: unknown) {
// assert
if (error instanceof Error) {
console.error('Error message:', error.message)

// Narrowing the error further to check for HTTP status
const statusMatch = error.message.match(/HTTP error: (\d+)/)
if (statusMatch) {
const status = Number.parseInt(statusMatch[1], 10)
console.error('HTTP Status Code:', status)
expect(status).to.equal(405)
}
}
Expand Down

0 comments on commit 8685067

Please sign in to comment.