-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest.js
More file actions
49 lines (35 loc) · 976 Bytes
/
Copy pathtest.js
File metadata and controls
49 lines (35 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* global t */
import test from 'ava';
var atmIn = ["credit", 3000, "From ATM"];
test('files are created', t => {
var fileExists = require('file-exists');
var xdgBasedir = require('xdg-basedir');
var expensesFilepath = xdgBasedir.data + '/wallet/expenses.csv';
require('./setup-files.js');
return fileExists(expensesFilepath);
});
test('wrong date is not allowed', t => {
var module = require('./');
module(atmIn, {});
var input = ["debit", 50, "Coffee and mufin - one more time"];
var opts = {d: "2015-5-5"};
t.throws(function() {
module(input, opts);
});
});
test('wrong debit/credit is not allowed', t => {
var module = require('./');
module(atmIn, {});
var input = ["debit", 50];
t.throws(function() {
module(input, {});
});
});
test('wrong stash transactions are not allowed', t => {
var module = require('./');
module(atmIn, {});
var input = ["stash"];
t.throws(function() {
module(input, {});
});
});