const fs = require('fs') const titles = require('../titles') const path_not_exists = (message) => { console.error('path not exists (titles.json): \n', message) } const test_titles = () => { var titles_pass = true titles.forEach(title => { if (!fs.existsSync(title.path)) { titles_pass = false path_not_exists(`\ttitle: ${title.title}, path: ${title.path}`) } }) return titles_pass } module.exports = { test_titles }