(config = {})
| 8 | */ |
| 9 | class TestServer { |
| 10 | constructor(config = {}) { |
| 11 | this.app = express() |
| 12 | this.server = null |
| 13 | this.port = config.port || 8010 |
| 14 | this.host = config.host || 'localhost' |
| 15 | this.dbFile = config.dbFile || path.join(__dirname, '../test/data/rest/db.json') |
| 16 | this.readOnly = config.readOnly || false |
| 17 | this.lastModified = null |
| 18 | this.data = this.loadData() |
| 19 | |
| 20 | this.setupMiddleware() |
| 21 | this.setupRoutes() |
| 22 | this.setupFileWatcher() |
| 23 | } |
| 24 | |
| 25 | loadData() { |
| 26 | try { |
nothing calls this directly
no test coverage detected