V 0.1.1 intermediate changes
Co-authored-by: Oscar Urselli <oscar0urselli@users.noreply.github.com>
This commit is contained in:
27
tests/unit/filewatch.test.ts
Normal file
27
tests/unit/filewatch.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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")
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user