mirror of
https://github.com/scratchfoundation/scratch-auth.git
synced 2025-06-29 11:30:20 -04:00
25 lines
562 B
JavaScript
25 lines
562 B
JavaScript
const test = require('tap').test;
|
|
const Auth = require('../../index');
|
|
|
|
const object = {foo: 'bar'};
|
|
const encoded = 'eyJmb28iOiJiYXIifQ==';
|
|
|
|
test('spec', function (t) {
|
|
const a = new Auth();
|
|
t.type(Auth, 'function');
|
|
t.type(a, 'object');
|
|
t.type(a.unpack, 'function');
|
|
t.end();
|
|
});
|
|
|
|
test('uncompressed', function (t) {
|
|
const a = new Auth();
|
|
t.strictDeepEqual(a.unpack(encoded), object);
|
|
t.end();
|
|
});
|
|
|
|
test('invalid', function (t) {
|
|
const a = new Auth();
|
|
t.strictDeepEqual(a.unpack(undefined), undefined);
|
|
t.end();
|
|
});
|