add test
This commit is contained in:
parent
4d35b986f9
commit
82c743c120
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
/node_modules/
|
||||
/dist/
|
||||
/.nyc_output/
|
||||
/coverage/
|
||||
|
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');
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user