- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
27 lines
842 B
JavaScript
27 lines
842 B
JavaScript
/* globals describe, it */
|
|
import * as bytes from '../src/bytes.js'
|
|
import { assert } from 'aegir/chai'
|
|
|
|
describe('bytes', () => {
|
|
it('isBinary', () => {
|
|
assert.deepStrictEqual(bytes.isBinary(new ArrayBuffer(0)), true)
|
|
assert.deepStrictEqual(bytes.isBinary(new DataView(new ArrayBuffer(0))), true)
|
|
})
|
|
|
|
it('coerce', () => {
|
|
const fixture = bytes.fromString('test')
|
|
assert.deepStrictEqual(bytes.coerce(fixture.buffer), fixture)
|
|
assert.deepStrictEqual(bytes.coerce(new DataView(fixture.buffer)), fixture)
|
|
})
|
|
|
|
it('equals', () => {
|
|
const fixture = bytes.fromString('test')
|
|
assert.deepStrictEqual(bytes.equals(fixture, bytes.fromString('asdfadf')), false)
|
|
})
|
|
|
|
it('toString()', () => {
|
|
const fixture = 'hello world'
|
|
assert.deepStrictEqual(bytes.toString(bytes.fromString(fixture)), fixture)
|
|
})
|
|
})
|