Spaces:
Running
Running
File size: 636 Bytes
30c32c8 |
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 |
const test = require('tap').test;
const UserData = require('../../src/io/userData');
test('spec', t => {
const userData = new UserData();
t.type(userData, 'object');
t.type(userData.postData, 'function');
t.type(userData.getUsername, 'function');
t.end();
});
test('getUsername returns empty string initially', t => {
const userData = new UserData();
t.strictEquals(userData.getUsername(), '');
t.end();
});
test('postData sets the username', t => {
const userData = new UserData();
userData.postData({username: 'TEST'});
t.strictEquals(userData.getUsername(), 'TEST');
t.end();
});
|