Skip to content

Commit

Permalink
update tests for new json
Browse files Browse the repository at this point in the history
  • Loading branch information
zfletch committed Aug 22, 2019
1 parent 3982ec7 commit d4c4b86
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
Beta Code JS
===================
# Beta Code JS

Overview
--------
## Overview

Converts Greek beta code to Greek characters and vice versa.

Try it Out
----------
## Try it Out

[https://zfletch.github.io/beta-code-converter-js/](https://zfletch.github.io/beta-code-converter-js/)
[https://apps.perseids.org/beta-code/](https://apps.perseids.org/beta-code/)

Installation
------------
## Installation

`npm install beta-code-js`

Usage
-----
## Usage

```javascript
import { greekToBetaCode, betaCodeToGreek } from 'beta-code-js';
Expand All @@ -42,8 +37,7 @@ bc.betaCodeToGreek('mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os');

```

Usage in Browser
----------------
## Usage in Browser

```html
<html>
Expand All @@ -61,18 +55,29 @@ Usage in Browser
</html>
```

Tests
-----
## Tests

`npm test`

Building for Browser
--------------------
## Building for Browser

`npm run bundle`

Notes
-----
## Updating JSON

```bash
git subtree pull --prefix vendor/beta-code-json/ https://github.com/zfletch/beta-code-json master --squash
```

In the case of a merge conflict:

```bash
git checkout --theirs vendor/beta-code-json/ # if necessary
git add vendor/beta-code-json
git commit
```

## Notes

For the mappings between beta code and Unicode, see [https://github.com/zfletch/beta-code-json](https://github.com/zfletch/beta-code-json).
For an example of this package being used, see [https://github.com/zfletch/beta-code-converter-js](https://github.com/zfletch/beta-code-converter-js).
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,14 @@ describe('#betaCodeToGreek', function() {
expect(bc.betaCodeToGreek(beta_code1)).to.equal(greek);
expect(bc.betaCodeToGreek(beta_code2)).to.equal(greek);
});

it('should convert characters with different capitalization orders', function() {
var beta_code1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis';
var beta_code2 = '*(/orkos *)/azwton *(/ellhnas *)=apis';
var greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις';

expect(bc.betaCodeToGreek(beta_code1)).to.equal(greek);
expect(bc.betaCodeToGreek(beta_code2)).to.equal(greek);
});
});
})();

0 comments on commit d4c4b86

Please sign in to comment.