add test
This commit is contained in:
26
test/index.js
Normal file
26
test/index.js
Normal 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');
|
||||
});
|
Reference in New Issue
Block a user