2021-04-07 09:39:48 +02:00
|
|
|
// @ts-nocheck interface tests
|
2020-07-15 12:29:36 +02:00
|
|
|
/* eslint-env mocha */
|
|
|
|
|
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const chai = require('chai')
|
|
|
|
const expect = chai.expect
|
|
|
|
chai.use(require('dirty-chai'))
|
|
|
|
|
|
|
|
module.exports = (test) => {
|
|
|
|
describe('record', () => {
|
|
|
|
let record
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
record = await test.setup()
|
|
|
|
if (!record) throw new Error('missing record')
|
|
|
|
})
|
|
|
|
|
|
|
|
afterEach(() => test.teardown())
|
|
|
|
|
|
|
|
it('has domain and codec', () => {
|
|
|
|
expect(record.domain).to.exist()
|
|
|
|
expect(record.codec).to.exist()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('is able to marshal', () => {
|
|
|
|
const rawData = record.marshal()
|
2020-08-24 12:20:24 +02:00
|
|
|
expect(rawData).to.be.an.instanceof(Uint8Array)
|
2020-07-15 12:29:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('is able to compare two records', () => {
|
|
|
|
const equals = record.equals(record)
|
|
|
|
expect(equals).to.eql(true)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|