commit 676488b6aaf1ac75a8b22c6b5f8fc22a154af901
parent d552baa58a9c28242f9b03d4fa8480ba4532f770
Author: Jared Tobin <jared@jtobin.io>
Date: Wed, 7 Aug 2019 17:15:24 -0230
Merge pull request #26 from urbit/jt-api-test
Add a simple API test
Diffstat:
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/package-lock.json b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "urbit-ob",
- "version": "4.0.2",
+ "version": "4.1.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/test/api.test.js b/test/api.test.js
@@ -0,0 +1,29 @@
+const ob = require('../src')
+const { expect } = require('chai')
+
+describe('the public-facing API', () => {
+
+ const zod = '~zod'
+ const zoddec = '0'
+ const zodhex = '00'
+ const zodclan = 'galaxy'
+
+ it('contains the appropriate exports', () => {
+ expect(ob.patp(zoddec)).to.equal(zod)
+ expect(ob.patp2hex(zod)).to.equal(zodhex)
+ expect(ob.hex2patp(zodhex)).to.equal(zod)
+ expect(ob.patp2dec(zod)).to.equal(zoddec)
+ expect(ob.sein(zod)).to.equal(zod)
+ expect(ob.clan(zod)).to.equal(zodclan)
+
+ expect(ob.patq(zoddec)).to.equal(zod)
+ expect(ob.patq2hex(zod)).to.equal(zodhex)
+ expect(ob.hex2patq(zodhex)).to.equal(zod)
+ expect(ob.patq2dec(zod)).to.equal(zoddec)
+
+ expect(ob.eqPatq(zod, zod)).to.equal(true)
+ expect(ob.isValidPatp(zod)).to.equal(true)
+ expect(ob.isValidPatq(zod)).to.equal(true)
+ })
+})
+