SSL-Sniffer/tests/unit/filewatch.test.ts
Christian Risi f23cb0e1d2 V 0.1.1 intermediate changes
Co-authored-by: Oscar Urselli <oscar0urselli@users.noreply.github.com>
2025-07-03 18:25:50 +00:00

28 lines
573 B
TypeScript

import { describe, it, expect } from 'vitest';
import { watch } from "node:fs"
import * as readline from "node:readline"
// TODO: make tests for Database
describe('watch nginx', () => {
const OPTIONS = {
recursive: true
}
const NGINX_BASE = "/etc/nginx"
const input = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
watch(NGINX_BASE, OPTIONS, (eventType, filename) => {
console.log(`event: ${eventType}`)
console.log(`file: ${filename}`)
})
console.log("Done")
});