blacklist import export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-01-09 12:20:14 +01:00
parent d6a40871c4
commit c5bc0855d7
3 changed files with 33 additions and 1 deletions

View File

@ -5,7 +5,7 @@
* Created by Timo Hocker <timo@scode.ovh>, December 2020
*/
import blacklist from '../../lib/Blacklist';
import blacklist, { Blacklist } from '../../lib/Blacklist';
import { clock_finalize, clock_setup } from '../Helper';
// eslint-disable-next-line max-lines-per-function
@ -60,4 +60,16 @@ describe ('blacklist', () => {
expect (blacklist.is_valid ('baz'))
.toBeFalse ();
});
it ('should export and import data', () => {
const exp = blacklist.export_blacklist ();
// eslint-disable-next-line dot-notation
expect (blacklist['_signatures'])
.toEqual (exp);
const bl2 = (new Blacklist);
bl2.import_blacklist (exp);
// eslint-disable-next-line dot-notation
expect (bl2['_signatures'])
.toEqual (exp);
});
});