title: Data driven Jestjs tests
body: <p>Is there a way to write more data driven tests with Jestjs?</p>
  
  <p>I came up with something like this:</p>
  
  <pre><code>    it('assignments and declarations', () =&gt; {
  
      testCases.forEach(function (testCase) {
          const slx = fs.readFileSync(testDirectory + 'slx/' + testCase.slx, 'utf-8');
  
          const document = compiler.parse(slx);
  
          const lmsGenerator = new LMSGenerator(document);
          const lms = lmsGenerator.generate();
  
          const expected = fs.readFileSync(testDirectory + 'lms/' + testCase.lms, 'utf-8');
  
          expect(expected).toBe(lms);
      });
  });
  </code></pre>
  
  <p>I read the input and the expected output out of files. The files (and the link between input and output) are saved in an array with objects. The problem is that I lost the specific errors messages I had with multiple it() functions.</p>
  
  <p>Is there a way to do this better? Or to use an individual message for the case the expected-call will fail?</p>