mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-05-02 05:34:30 +02:00
initial import
This commit is contained in:
14
javascript/test/statement.test.js
Normal file
14
javascript/test/statement.test.js
Normal 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/);
|
||||
});
|
||||
Reference in New Issue
Block a user