initial import

This commit is contained in:
Emily Bache
2019-08-06 09:34:28 +02:00
commit bf6bfd3ddb
12 changed files with 173 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
const statement = require('../src/statement');
const fs=require('fs');
test('example statement', () => {
const invoice = JSON.parse(fs.readFileSync('test/invoice.json', 'utf8'));
const plays = JSON.parse(fs.readFileSync('test/plays.json', 'utf8'));
expect(statement(invoice, plays)).toMatchSnapshot();
});
test('statement with new play types', () => {
const invoice = JSON.parse(fs.readFileSync('test/invoice_new_plays.json', 'utf8'));
const plays = JSON.parse(fs.readFileSync('test/new_plays.json', 'utf8'));
expect(() => {statement(invoice, plays)}).toThrow(/unknown type/);
});