mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-01-11 22:30:27 +01:00
14 lines
606 B
JavaScript
14 lines
606 B
JavaScript
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/);
|
|
}); |