Tests for atob, btoa

This commit is contained in:
Angelos Chalaris
2018-01-24 17:33:38 +02:00
parent 449dfdea1c
commit 47cc6a376a
3 changed files with 12 additions and 6 deletions

View File

@ -5,9 +5,11 @@ test('Testing atob', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof atob === 'function', 'atob is a Function');
t.equals(atob('Zm9vYmFy'), 'foobar', 'atob("Zm9vYmFy") equals "foobar"');
t.equals(atob('Z'), '', 'atob("Z") returns ""');
//t.deepEqual(atob(args..), 'Expected');
//t.equal(atob(args..), 'Expected');
//t.false(atob(args..), 'Expected');
//t.throws(atob(args..), 'Expected');
t.end();
});
});

View File

@ -5,9 +5,10 @@ test('Testing btoa', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof btoa === 'function', 'btoa is a Function');
t.equals(btoa('foobar'), 'Zm9vYmFy', 'btoa("foobar") equals "Zm9vYmFy"');
//t.deepEqual(btoa(args..), 'Expected');
//t.equal(btoa(args..), 'Expected');
//t.false(btoa(args..), 'Expected');
//t.throws(btoa(args..), 'Expected');
t.end();
});
});

View File

@ -1,4 +1,4 @@
Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
Test log for: Wed Jan 24 2018 17:33:18 GMT+0200 (GTB Standard Time)
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
> tape test/**/*.test.js | tap-spec
@ -20,6 +20,8 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
Testing atob
√ atob is a Function
√ atob("Zm9vYmFy") equals "foobar"
√ atob("Z") returns ""
Testing average
@ -59,6 +61,7 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
Testing btoa
√ btoa is a Function
√ btoa("foobar") equals "Zm9vYmFy"
Testing byteSize
@ -1454,8 +1457,8 @@ Test log for: Wed Jan 24 2018 17:16:12 GMT+0200 (GTB Standard Time)
√ zipWith is a Function
total: 618
passing: 618
duration: 412ms
total: 621
passing: 621
duration: 417ms