@gameroom/kit
Version:
Node kit for the Gameroom API
25 lines (21 loc) • 523 B
JavaScript
const { faker } = require('@faker-js/faker'),
chai = require('chai')
const {
helpers: { encode, decode }
} = require('../../')
const should = chai.should()
describe('encode()', () => {
it('should encode given string', async () => {
let result, error
const string = faker.random.word()
try {
result = encode(string)
} catch (err) {
error = err
}
should.not.exist(error)
should.exist(result)
result.should.not.equal(string)
string.should.equal(decode(result))
})
})