This commit is contained in:
Timo Hocker 2020-03-04 13:07:06 +01:00
parent 4d35b986f9
commit 82c743c120
2 changed files with 29 additions and 1 deletions

4
.gitignore vendored
View File

@ -1,2 +1,4 @@
/node_modules/
/dist/
/dist/
/.nyc_output/
/coverage/

26
test/index.js Normal file
View File

@ -0,0 +1,26 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
// @ts-nocheck
'use strict';
const test = require ('ava');
const encoding = require ('../index');
test ('encoding to_hex', (t) => {
const hex = encoding.to_hex ('foo');
t.is (hex, '666f6f');
});
test ('encoding to_b64', (t) => {
const hex = encoding.to_b64 ('foo');
t.is (hex, 'Zm9v');
});
test ('encoding to_utf8', (t) => {
const utf = encoding.to_utf8 ('Zm9v', 'base64');
t.is (utf, 'foo');
});