urbit-ob

JavaScript utilities for phonemic base wrangling.
git clone git://git.jtobin.io/urbit-ob.git
Log | Files | Refs | README

api.test.js (889B)


      1 const ob = require('../src')
      2 const { expect } = require('chai')
      3 
      4 describe('the public-facing API', () => {
      5 
      6   const zod = '~zod'
      7   const zoddec = '0'
      8   const zodhex = '00'
      9   const zodclan = 'galaxy'
     10 
     11   it('contains the appropriate exports', () => {
     12     expect(ob.patp(zoddec)).to.equal(zod)
     13     expect(ob.patp2hex(zod)).to.equal(zodhex)
     14     expect(ob.hex2patp(zodhex)).to.equal(zod)
     15     expect(ob.patp2dec(zod)).to.equal(zoddec)
     16     expect(ob.sein(zod)).to.equal(zod)
     17     expect(ob.clan(zod)).to.equal(zodclan)
     18 
     19     expect(ob.patq(zoddec)).to.equal(zod)
     20     expect(ob.patq2hex(zod)).to.equal(zodhex)
     21     expect(ob.hex2patq(zodhex)).to.equal(zod)
     22     expect(ob.patq2dec(zod)).to.equal(zoddec)
     23 
     24     expect(ob.eqPatq(zod, zod)).to.equal(true)
     25     expect(ob.isValidPat(zod)).to.equal(true)
     26     expect(ob.isValidPatp(zod)).to.equal(true)
     27     expect(ob.isValidPatq(zod)).to.equal(true)
     28   })
     29 })
     30