Skip to content

Commit

Permalink
calculator added
Browse files Browse the repository at this point in the history
  • Loading branch information
rotemgrim committed Jun 20, 2018
1 parent c0970f9 commit 6f296c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "Typie",
"version": "1.0.11",
"version": "1.0.12",
"license": "MIT",
"author": "Rotem Grimberg <rotemgrim@gmail.com>",
"homepage": "https://github.com/typie",
Expand All @@ -26,7 +26,7 @@
"electron-log": "^2.2.14",
"fs-extra": "^5.0.0",
"js-yaml": "^3.11.0",
"mathjs": "^4.4.2",
"mathjs": "^5.0.0",
"mkdirp": "^0.5.1",
"npm": "^6.0.1",
"source-map-support": "^0.5.5",
Expand Down
4 changes: 2 additions & 2 deletions src/main/packages/calculator/Calculator.ts
Expand Up @@ -5,8 +5,8 @@ import math from "mathjs";
const calcIcon = getPath("themes/default/images/calculator-icon.png");
math.config({predictable: true});

export default class Calculator extends AbstractTypiePackage
{
export default class Calculator extends AbstractTypiePackage {

public static tryMathExpression(res, obj: SearchObject) {
try {
const answer = String(math.eval(obj.value));
Expand Down
Binary file modified static/bin/typie_go
Binary file not shown.
7 changes: 5 additions & 2 deletions test/main/test.js
Expand Up @@ -6,8 +6,11 @@ describe('electron-mocha', function () {
it('runs in main process by default', function () {
assert.strictEqual(process.type, 'browser')
});
it('checks that 1 dose not equal 5', () => {
assert.notEqual(1, 5);
it('checks that calculator is working', () => {
//const Calculator = require("../../src/main/packages/calculator/Calculator.ts");
//let res = [];
//res = Calculator.tryMathExpression(res, {value: "5+5"});
//assert.equal(res[0].getPath(), 10);
})
it('checks that electron clipboard is working', () => {
clipboard.writeText("save text");
Expand Down

0 comments on commit 6f296c2

Please sign in to comment.