const path = require('path') const fs = require('fs') const assert = require('assert') const {processMessage} = require('../processors/parsing') const BASE_PATH = path.join('/', 'Users', 'juan', 'Downloads', 'sample data') const tests = [] function it(name, testFn) { tests.push(testFn) } function test() { tests.reduce((prev, t) => prev.then(() => t()), Promise.resolve()) .then(() => console.log('Success!')) .catch((err) => console.log(err)) } it('parses the message correctly', () => { const bodyPath = path.join(BASE_PATH, '1-99174-body.txt') const headersPath = path.join(BASE_PATH, '1-99174-headers.txt') const rawBody = fs.readFileSync(bodyPath, 'utf8') const rawHeaders = fs.readFileSync(headersPath, 'utf8') const message = { rawHeaders, rawBody } return processMessage({message}).then((processed) => { const bodyPart = `
In _data/apps.yml:
` assert.equal(processed.headers['in-reply-to'], '