import {expect} from "chai"

describe('RandomID', function () {

    class RandomID {}
    
    before(function (done) {

        let promises = []
        if(!globalThis['crypto']) {
            promises.push(import("@peculiar/webcrypto").then(m => {
                globalThis['crypto'] = new m.Crypto();
                return true;
            }))
        }

        promises.push(import("../../../source/types/randomid.mjs").then(m => {
            RandomID = m.RandomID;
            return true;
        }))

        Promise.all(promises).then(() => {
            done()
        });

    });    
    
    describe('.toString()', function () {
        let id = new RandomID()
        let result = id.toString();

        it('should return a string', function () {
            expect(result).is.a('string')
        });

    });

});

