Skip to content

Commit

Permalink
Refactor: Separate Create Config Handler (#1272)
Browse files Browse the repository at this point in the history
* refactor: separate create config flag handler

* docs: fix grammar
  • Loading branch information
haricnugraha authored Apr 18, 2024
1 parent 97e8e3e commit ac30cf2
Show file tree
Hide file tree
Showing 7 changed files with 547 additions and 384 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ probes:
followRedirects: 0
alerts:
- assertion: response.status != 302
message: You should not follow redirect
message: You should not follow the redirect
- id: 'should follow redirect with default config'
requests:
- url: http://localhost:3000/absolute-redirect/20
alerts:
- assertion: response.status == 302
message: You are not follow redirect
- id: 'should follow redirect with customize config'
message: You are not following the redirect
- id: 'should follow redirect with customized config'
requests:
- url: http://localhost:3000/status/302
followRedirects: 2
alerts:
- assertion: response.status == 302
message: You are not follow redirect
message: You are not following the redirect
```
##### MariaDB
Expand Down
5 changes: 3 additions & 2 deletions src/commands/monika.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import pEvent from 'p-event'
import type { Config } from '../interfaces/config'
import type { Probe } from '../interfaces/probe'

import { createConfig, getConfig, isSymonModeFrom } from '../components/config'
import { getConfig, isSymonModeFrom } from '../components/config'
import { createConfig } from '../components/config/create'
import { sortProbes } from '../components/config/sort'
import { printAllLogs } from '../components/logger'
import { flush } from '../components/logger/flush'
Expand Down Expand Up @@ -350,7 +351,7 @@ export default class Monika extends Command {

try {
if (_flags['create-config']) {
await createConfig(_flags)
await createConfig()
return
}

Expand Down
240 changes: 0 additions & 240 deletions src/components/config/__tests__/create-config.test.ts

This file was deleted.

Loading

0 comments on commit ac30cf2

Please sign in to comment.