From 82c743c1208fed9f40664912b2750695db8a00e5 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 4 Mar 2020 13:07:06 +0100 Subject: [PATCH] add test --- .gitignore | 4 +++- test/index.js | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test/index.js diff --git a/.gitignore b/.gitignore index c85804c..e5c296b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /node_modules/ -/dist/ \ No newline at end of file +/dist/ +/.nyc_output/ +/coverage/ diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..7ca25f4 --- /dev/null +++ b/test/index.js @@ -0,0 +1,26 @@ +/* + * Copyright (C) Sapphirecode - All Rights Reserved + * Created by Timo Hocker , 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'); +});