fix
This commit is contained in:
12
test/Node.ts
12
test/Node.ts
@ -49,8 +49,18 @@ test ('serialize table', (t) => {
|
||||
});
|
||||
|
||||
test ('adhere to naming convention', (t) => {
|
||||
const n = new Node ('invalid.name', 'parent');
|
||||
t.is (n.name, 'invalidname');
|
||||
});
|
||||
|
||||
test ('throw on invalid name', (t) => {
|
||||
t.throws (() => {
|
||||
const n = new Node ('invalid.name', 'parent');
|
||||
const n = new Node ('564#+-.,/@', 'parent');
|
||||
return n.toString ();
|
||||
}, { message: 'invalid name specified' });
|
||||
});
|
||||
|
||||
test ('leave numbers after the first letter', (t) => {
|
||||
const n = new Node ('i123nvalid.name', 'parent');
|
||||
t.is (n.name, 'i123nvalidname');
|
||||
});
|
||||
|
Reference in New Issue
Block a user