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'); +});